Hi. I am trying to write a program to manage a computer lab with 2 types of computer, PC and Sun. The program takes the input of computer name, ip, hd size, and admin pass. The Sun has an additional parameter of server type.The program needs to be able to add a computer, modify a computer, delete a computer, display the info for a computer, and be able to search by name and ip. I wrote the code for the add and delete functions just to test to see if I was on the right track.
These are the errors that I am getting from Visual C++
using namespace std;
void PC::addcomp(int x)
cout << "Input name of computer: ";
cin >> name[x];
cout << "Input IP address: ";
cin >> ip[x];
cout << "Input size of hard disk (in GB): ";
cin >> hd[x];
cout << "Input Admin password: ";
cin >> adpass[x];
void PC::deletecomp(int x)
cout << "::Select an operation::\n"<< "1) Add a Computer\n" << "2) Delete a Conputer\n" << "3) Modify a Computer\n" << "4) Search by Computer Name\n" << "5) Search by IP\n" << "6) Display Computer Information\n";
cin >> a;
cout << "Enter computer number: ";
cin >> x;
if(a == 1)
if (a == 2)
I'm just starting out with classes so I'm not sure I have mine setup the way they should be. Also, should I simply write zeros to the arrays to clear them or is there a better way to do it? Any advice on my errors or how I should implement classes would be appriciated.
comuter.obj : error LNK2001: unresolved external symbol "public: __thiscall PC::PC(void)" (??0PC@@QAE@XZ)
Debug/computer.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.