Stupid Strings [RESOLVED]
I've always been baffled by this as I haven't paid much attention to it but now that I am, I'm reliving the irritability (is that a word?) of my past pains.
Strings in C++...
I've seen tutorials and books that say stuff like this as for the declaration of a string:
Code:
#include <string>
string str1;
Then I've seen this as an initialization for a string:
Code:
str1("Hello");
str1 = "Hello";
Now why is it I'm seeing this as examples from tutorials but when I do this in my code, all the time, I'll get this nice little error from the compiler (and I quote):
Quote:
'string' does not name a type
This is a SECTION of code where the compiler complains:
Code:
typedef class item{
private:
ITEM_TYPE type;
string name; //right here!!!!!
string desc; //and here too!!!!
int buyPrice;
int sellPrice;
BITMAP *sprite;
Could someone tell me why this is happening? Thanks in advance