Results 1 to 2 of 2
Hi all,
I'm new to C++ programing and also new to gcc compiler. I'm really appreciate if someone show me what's wrong with my code
As per Attachment.
Warmest Regards,...
- 09-19-2010 #1Just Joined!
- Join Date
- Mar 2007
- Posts
- 5
undefined reference to `getdata(StudentInfo&)'
Hi all,
I'm new to C++ programing and also new to gcc compiler. I'm really appreciate if someone show me what's wrong with my code
As per Attachment.
Warmest Regards,
- 09-19-2010 #2Linux Newbie
- Join Date
- Mar 2010
- Posts
- 121
Your function doesn't match its prototype (same for printdata()). main() expects to use the function getdata(StudentInfo&), but getdata(StudentInfo student[3]) is a different function (read-up on "function overloading" to see why.Code:void getdata(StudentInfo&); ... void getdata(StudentInfo student[3]) { ... }
Fix: Change your declarations to match the definitions.


Reply With Quote