Hey guys, I'm having some problems with a program I'm writing for my class. One of the steps calls for me to write a function that uses a pointer to a structure variable as a parameter. I've tried ever variation I can think of, but I'm not getting anywhere. I keep getting errors relating to overloading my function or something about an unresolved external symbol. The program and the function are incomplete while I try to solve this problem. Here's my program so far (the specific areas are lines 12, 86, and 101):
yes, your forward declaration isn't compatible with the actual definition of the addTraders() function. This causes the unresolved external error. In line 86 you call addTraders() with only two arguments, and there have to be three. So: change int addTraders (int *department, int maxDept, int index) to int addTraders( DeptData* department, int maxDept, int index ), add a maxDept argument at line 86, and change the body of addTraders(), so that is works in the right way.
Sorry about that. I've revised my program to how it's supposed to look and I'm still having problems. The errors I'm getting:
error LNK2019: unresolved external symbol "void __cdecl addTraders(struct DeptData *,int)" (?addTraders@@YAXPAUDeptData@@H@Z) referenced in function _main
C:\Users\owner\Desktop\Josh - School\CSCI2010\Pass5\Debug\Pass5.exe : fatal error LNK1120: 1 unresolved externals
I also tried to put in DeptData* department in my call, but it says type name is not allowed, so I changed it to arrPtr, which is supposed to point to the array in line 19.
Here is my revised code, with the problems still on lines 12, 86, and 101 (and possibly 19):
That worked perfectly, thank you. And sorry for the simple questions. I've been studying for 4 midterms tomorrow and doing this assignment, so my brains on the mushy side right now. Thanks again.