I'm experimenting with pass by value/reference and im having trouble maybe someone can help.
ill just post a simplified example of the problem i am having. i know it has something to do with pointers but everything i try doesent work.
Function call
emp has no value when brought into functionCode:readname (fin, a, emp);
function
num_emp = 2 when it prints in the functionCode:void readname(FILE* fin, struct emp a[1024], int num_emp) { fscanf(fin, "%d", &num_emp); printf("%d", num_emp); }
then in main i print emp right after this function runs to check its value... ant it's 0 again.
do i need an ampersand somewhere?
thanks for the help.



LinkBack URL
About LinkBacks



