How can I return multiple values from a function?

Showing Answers 1 - 7 of 7 Answers

Capreatki

  • Jul 19th, 2005
 

Use pointers... i think this is the best way to return multiple values from a functions....

  Was this answer useful?  Yes

Tanushri Banerjee

  • Jul 19th, 2005
 

If we call the function inside the loop we can  
get

  Was this answer useful?  Yes

Santosh

  • Jul 20th, 2005
 

1. Using Function Pointers we can....

  Was this answer useful?  Yes

Girish

  • Jul 23rd, 2005
 

How to return multiple values from a function using Function Pointer ....

  Was this answer useful?  Yes

Sudhakar

  • Oct 10th, 2005
 

Either pass pointers to several locations which the function can fill in, or have the function return a structure containing the desired values, or (in a pinch) consider global variables.This solution is taken from comp.lang.c faqLink:http://www.eskimo.com/~scs/C-faq/q20.1.html

  Was this answer useful?  Yes

prakash

  • Jan 28th, 2006
 

pass multiple variables to the function as formal parameters ... function will actually set those values (output variables).

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions