I have been asked this question once or twice in interviews. I am not sure whether it’s possible or not. Maybe structures in C are a way out? Can anyone elaborate on this further?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the two values are inside a structure, then you can use the function’s return value instead of passing by reference:
…though even then it’s probably more practical to use pointers.