sorry if this is really stupid but I am trying as hard as I can to understand classes from a book. I have declared my class and put in the accessor functions and declared everything private/public as I have been told.
I want to write a program that keeps a employee record. It asks the user for the data and then prints it back out to confirm it has all worked and has been stored correctly.
I have cut down the code attached to just one peice of data (the employee number) and two accessor methods untill I get this right. The problem is that when I run the program it just flicks up the console screen and then it vanishes despite the system("PAUSE"); after return 0; (I know, I know it's bad and I proboly shouldn't use it).
Can anyone tell me what I'm doing wrong and how to fix it. Many thanks
#include <iostream>using namespace std;
void setp_number(int number);
void record::setp_number(int number)
p_number = number;
cout << "set employee number: ";
cin >> number;
cout << "Thanks! To confirm:...." << endl;
cout << "Clive is number: " << Clive.getp_number();