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 to return multiple values from a function?

Answer Posted / splurgeop

you can return multiple values from the function by using
mechanism called "call-by-reference".
for example:

void main()
{
int area,*circumference;
area=function(area,circumference);
cout<<"the area is "<<area;
cout<<"the circumference is"<<circumference;
}
int function(int a,int *b)
{
a=12;
int temp=a*3;
b=&temp;
return a;
}

// this is just an example............


// you can also use array and return the adress of the
array in the main and can use to traverse the entire array
and return multiple values from function.

Is This Answer Correct ?    34 Yes 60 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a program for area of circumference of shapes

2513


Design an implement of the inputs functions for event mode

3466


How to palindrom string in c language?

10842


why nlogn is the lower limit of any sort algorithm?

2792


#include int main(void) { int a=4, b=2; a=b<>2 ; printf("%d",a); return 0; }

1581


Write a routine to implement the polymarker function

4842


3) Int Matrix of certain size was given, We had few valu= es in it like this. =97=97=97=97=97=97=97=97=97=97=97 1 = | 4 | | 5 | &= nbsp; | 45 =97=97=97=97=97=97=97=97=97=97=97 &n= bsp; | 3 | 3 | 5 | = | 4 =97=97=97=97=97=97=97=97=97=97=97 34 |&nbs= p; 3 | 3 | | 12 | &= nbsp; =97=97=97=97=97=97=97=97=97=97=97 3 | &nbs= p; | 3 | 4 | = | 3 =97=97=97=97=97=97=97=97=97=97=97 3 | = ; | | | = ; 3 | =97=97=97=97=97=97=97=97=97=97=97 &= nbsp; | | 4 | = ; | 4 | 3 We w= ere supposed to move back all the spaces in it at the end. Note: = If implemented this prog using recursion, would get higher preference.

3755


What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?

4451


create a C-code that will display the total fare of a passenger of a taxi if the driver press enter,the timer will stop. Every 10 counts is 2 pesos. Initial value is 25.00

6924


why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?

2726


can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail

2910


write a simple calculator c program to perform addition, subtraction, mul and div.

3684


Cluster head selection in Wireless Sensor Network using C programming language.

3685


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

2864


could you please send the program code for multiplying sparse matrix in c????

3533