Expand|Select|Wrap|Line Numbers
- #include <iostream>
- using namespace std;
- int main()
- {
- struct database {
- string name; // declares that the structure has a string
- // in it called name.
- }
- {
- int main()
- cout<<"Enter your name.\n"; //displays the obvious
- getline(cin, name, '\n'); // records the user's input into the string name,
- // and terminates the command when the user presses enter.
- database employee01;
- // declares the single structure and its contents
- employee01.name = string name;
- cout<<"Your name should be: "<<employee01.name<<".\n";
- cin.get();
- }
- }
11 C:\Documents and Settings\Main\My Documents\substring and structures.cpp expected `,' or `;' before '{' token
Could someone please explain to me what the "unqualified-id before" means, how to fix it, what I did wrong, and why it is the way that you say is the correct code?