C++ Trying to use a member function

This is a discussion on C++ Trying to use a member function within the C++ Programming forums, part of the General Programming Boards category; I have a program that uses a class "Employee" to create 3 employee's with names and salaries. I have a ...

  1. #1
    Registered User brianptodd's Avatar
    Join Date
    Oct 2002
    Posts
    66

    C++ Trying to use a member function

    I have a program that uses a class "Employee" to create 3 employee's with names and salaries. I have a function that calculates the average of the three salaries and outputs to the screen.

    Now I need to use an Employee class member function called print to format the same data to the screen.

    When I compile I get "request for member print is of a non-aggregate type".

    I have attached a zip file with the program (avg_sals.cpp) the Employee class files (employee.cpp and employee.h).

    The functions I am using are return_avg and print_avg.

    Thanks for any ideas.

    Brian
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    What do you need help with?

    Kuphryn

  3. #3
    UNBANNED OneStiffRod's Avatar
    Join Date
    Jan 2002
    Posts
    669
    BRIAN.....

    who is Cathy Bishop, community college 1999??



    BRIANNNNNN,,,\\\....
    My Avatar says: "Stay in School"

    Rocco is the Boy!
    "SHUT YOUR LIPS..."

  4. #4
    Registered User brianptodd's Avatar
    Join Date
    Oct 2002
    Posts
    66
    I am not able to call the member function "print" in the employee class from my print_avg function.

    Cathy Bishop is one of the CS faculty at my school.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 04-19-2008, 12:06 AM
  2. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  3. Calling a Thread with a Function Pointer.
    By ScrollMaster in forum Windows Programming
    Replies: 6
    Last Post: 06-10-2006, 08:56 AM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 09:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21