Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How can I return multiple values from a function?

Answer Posted / suman halder

1.we can apply "call by reference" mechanism within the
function so that multiple values get returned..

2.if the return types are homogeneous..i.e if we wanna return more than one integer values or more than one characters or any other type,then we can use an array to do that job for us as C provides various ways to return array from a function ..

*** if u try to return more than one value at a time through return statement ,last value will be returned and
all other values are ignored..
e.g
return 10,20,30;

it will only return 30

so,the most convenient way to do this is to use "call by reference" mechanism..

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain union. What are its advantages?

1075


Explain how can you be sure that a program follows the ansi c standard?

1471


Discuss the function of conditional operator, size of operator and comma operator with examples.

1157


An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?

1230


Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent

1821


What does stand for?

1079


develop algorithms to add polynomials (i) in one variable

2159


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1636


any "C" function by default returns an a) int value b) float value c) char value d) a & b

1080


How can I pad a string to a known length?

1032


what is different between auto and local static? why should we use local static?

1122


How many keywords (reserve words) are in c?

1135


How does struct work in c?

1081


code for replace tabs with equivalent number of blanks

2153


write an algorithm to display a square matrix.

2701