hi this is my first post. I need some help...
I have the following code:
#include <iostream>
using namespace std;
int date_birth(int year,int month,int day);
int main()
{
int a=0,b=0,c=0,x=0,y=0;
cout<<"Year ",cin>>a;
cout<<"Month ",cin>>b;
cout<<"Day",cin>>c;
x=date_birth(a,b,c);
y=date_birth(a,b,c);
cout<<"x "<<x<<endl;
cout<<"y "<<y<<endl;
return 0;
}
int date_birth(int year,int month,int day)
{
int a=0,b=0;
a=year+month;
b=month+day;
return (a,b);
}
My function just return the second parameter (b).
I need both of them.
How to code a function to return more than one value???
Help please.
Thanks, helios for your quick replie.
I am going to study pointers right now.