Debugging problems

It keeps saying that the file can't be found but I saved it... Here is the code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
#include <string>
using namespace std;

struct struture
{
	string name;
	int age;
	int grade;
}

struture pal =
{
	"William",
	15,
	10
}

int main()
{
	cout << pal.name << "is" << pal.age << "old and in grade" << pal.grade << endl;
	system("PAUSE");
	return 0;
} 

It looks good to me
Last edited on
what file? The problems I see have nothing to do with files. First off, you need to have a semicolon after your structure declaration on line 10 and after your variables on line 17.

Other than that the code compiles and runs fine for me. (well, other than bad spacing and that system pause).

edit: Make sure you're spelling your file name correctly when you're trying to compile.
Last edited on
Thanks for the help and it works fine now but it did say file can't be found.
Note: The amount of unhelpful and irrelevant compiler errors you will get by forgetting the semicolon at the end of a class declaration is directly proportional to the sum of the amount of lines below the declaration in every file it appears in.
Never, EVER, forget that semicolon.
Topic archived. No new replies allowed.