So my teacher gave us a sample code and it works just fine when runs the program however whenever I try to run it I have errors and he is not to sure as to why I get them. I have uninstalled my compiler and reinstalled it and I am using the same as his. The code is identical. Here are the errors I get with the sample code. Let me know if you need more info.
Desktop\Project 2\Contact.cpp||In function 'int main()':|
Desktop\Project 2\Contact.cpp|10|error: expected primary-expression before '(' token|
Desktop\Project 2\Contact.cpp|10|error: expected primary-expression before 'n'|
Desktop\Project 2\Contact.cpp|10|error: expected ';' before ':' token|
Desktop\Project 2\Contact.cpp|16|error: a function-definition is not allowed here before '{' token|
||=== Build finished: 4 errors, 0 warnings ===|
You can't define functions inside of main. Put those outside of main and then actually put code in main. Right now you have nothing that will actually do anything.
Awesome that error got fixed. ran into new ones. Here we are.
Desktop\Project 2\ContactList.cpp|5|error: expected unqualified-id before 'using'|
Desktop\Project 2\ContactList.cpp|15|error: ISO C++ forbids declaration of 'string' with no type|
Desktop\Project 2\ContactList.cpp|15|error: expected ',' or '...' before '&' token|
Desktop\Project 2\ContactList.cpp|15|error: prototype for 'void ContactList::addToHead(int)' does not match any in class 'ContactList'|
Desktop\Project 2\ContactList.h|12|error: candidate is: void ContactList::addToHead(const std::string&)|
||=== Build finished: 5 errors, 0 warnings ===|