String in a Structure

I have a structure defined in a header file like this

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
struct design
	{
		string name;
		int sheetsInStock;
		int envelopesInStock;
		int notepadsInStock;
		double sheetPrice;
		double envelopePrice;
		double notepadPrice;
		int dailySheetSales;
		int dailyEnvelopeSales;
		int dailyNotepadSales;
		int monthlySheetSales;
		int monthlyEnvelopeSales;
		int monthlyNotepadSales;
	}libraryOne[10], libraryTwo[10];


The problem is is that when I run the program I get the following errors and I'm not for sure why. I've done something similiar in a program before and it worked fine. Here are the error codes:

1>c:\users\casey\documents\danny\school\computer programming ii\projects\stationary shop\stationary shop\variables.h(5) : error C2146: syntax error : missing ';' before identifier 'name'
1>c:\users\casey\documents\danny\school\computer programming ii\projects\stationary shop\stationary shop\variables.h(5) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\casey\documents\danny\school\computer programming ii\projects\stationary shop\stationary shop\variables.h(5) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>main.cpp
1>c:\users\casey\documents\danny\school\computer programming ii\projects\stationary shop\stationary shop\variables.h(5) : error C2146: syntax error : missing ';' before identifier 'name'
1>c:\users\casey\documents\danny\school\computer programming ii\projects\stationary shop\stationary shop\variables.h(5) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\casey\documents\danny\school\computer programming ii\projects\stationary shop\stationary shop\variables.h(5) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>.\main.cpp(244) : error C2039: 'name' : is not a member of 'design'

That is exactly as it appears in the compiler.
did you #include <string> ? did you take care of std:: ?
I didn't think to take care of the std:: but I did add the library. Adding using namespace std; to the top of the file fixed the problem. I don't know really what the difference between this time and the last program I wrote was because none of that was necessary in that one. Oh well, thank you for your help.
You probably used std::string name instead of string name.
Topic archived. No new replies allowed.