Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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,
    Attached Files Attached Files

  2. #2
    Code:
    void getdata(StudentInfo&);
    ...
    void getdata(StudentInfo student[3])
    {
    ...
    }
    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.

    Fix: Change your declarations to match the definitions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •