English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

program to calculate the age of a person through month, date and year entered by the user?

2006-07-16 01:55:04 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

The call by reference is one of the time and memory saving ways to call a function.

Go this way...

suppose a main function is their:-

main()
{
int a,b;
int c;
a=30;
b=40;
c=add(a,b);
printf("\nValue of c=",c);
}


and the function for add is:-

int add(int &x,int &y)
{
int z;
z=x+y;
return z;
}

now what happens here is the "&" specifies that the variables used are actually diff name for the original variables. Hence if you change the variables in function then the original variables will also be changed....

ask more to me on...arjun_devane@yahoo.com

2006-07-16 02:17:48 · answer #1 · answered by arjun_devane 2 · 0 0

what are you asking ?

by the sound of it anything will do provided the call uses a reference rather than the value as in

myproc (byref myvar)

2006-07-16 08:59:29 · answer #2 · answered by Ivanhoe Fats 6 · 0 0

fedest.com, questions and answers