P
priyanka
Hi there,
I have a C programming problem for which I need help.
I have a structure pointer which has 3 different values in it.
I can print the value in the valriable in the stdout as:
cout << mp->core[employee_to_manager(22)];
This is the only way of retreiving the value of the employee number 22.
and the ouput is like this:
22 name = aka, val = 00
However, I need to print the same value in an external file called
list.txt.
I used:
fprintf(fp,"%d\n",mp->core[employee_to_manager(22)]);
But this does not work. It gives error like "segmentation fault".
Can anyone help me how to get "22 name = aka, val = 00" printed in the
file list.txt.
Thank you in advance,
priya
I have a C programming problem for which I need help.
I have a structure pointer which has 3 different values in it.
I can print the value in the valriable in the stdout as:
cout << mp->core[employee_to_manager(22)];
This is the only way of retreiving the value of the employee number 22.
and the ouput is like this:
22 name = aka, val = 00
However, I need to print the same value in an external file called
list.txt.
I used:
fprintf(fp,"%d\n",mp->core[employee_to_manager(22)]);
But this does not work. It gives error like "segmentation fault".
Can anyone help me how to get "22 name = aka, val = 00" printed in the
file list.txt.
Thank you in advance,
priya