Using struct in function

you can try the sample code here: