data structures using enter your option enter the first distance in kms and meters enter the second distance in kms and meters enter your option the sum of two distances is kms meters enter your option let us summarize some points that must be considered while passing structure to the called function if the called function is returning copy of the entire structure then it must be declared as struct followed by the structure name the structure variable used as parameter in the function declaration must be the same as that of the actual argument in the called function (and that should be the name of the struct typewhen function returns structurethen in the calling function the returned structure must be assigned to structure variable of the same type passing structures through pointers passing large structures to functions using the call by value method is very inefficient thereforeit is preferred to pass structures through pointers it is possible to create pointer to almost any type in cincluding the user-defined types it is extremely common to create pointers to structures like in other casesa pointer to structure is never itself structurebut merely variable that holds the address of structure the syntax to declare pointer to structure can be given asorstruct struct_name data_type member_name data_type member_name data_type member_name }*ptrstruct struct_name *ptrfor our student structurewe can declare pointer variable by writing struct student *ptr_studstudthe next thing to do is to assign the address of stud to the pointer using the address operator (&)as we would do in case of any other pointer so to assign the addresswe will write ptr_stud &studto access the members of structurewe can write /get the structurethen select member *(*ptr_studroll_nosince parentheses have higher precedence than *writing this statement would work well but this statement is not easy to work withespecially for beginner soc introduces new operator to do the same task this operator is known as 'pointing-tooperator programming tip (->it can be used asthe selection operator -is single tokenso do not place any white space between them /the roll_no in the structure ptr_stud points to *ptr_stud -roll_no this statement is far easier than its alternative