You don't ever set the values for num in the function...You should pass number into the function:
Code:
#include <iostream>
#include <cstdlib>
using namespace std;
struct complex
{
double real, imag, real1, imag1;
};
void value(double *pt1, double &pt2, complex num)
{
*pt1 = num.real + num.real1;
pt2 = num.imag + num.imag1;
}
int main(int argc, char *argv[])
{
complex number;
double val1;
double val2;
number.real=3;
number.imag=4;
number.real1 = atof(argv[1]);
number.imag1= atof(argv[2]);
value(&val1, val2,number);
cout << val1 << endl;
cout << val2 << endl;
system("PAUSE");
return 0;
}
PS cstdlib is the updated header for stdlib.h