string Data Members in Class

Oct 24, 2009 at 1:32am
I'm trying to create a simple class as a homework exercise. The problem I've run into happens when I try to create a private data member of type string. I included the header file <string>, but the compiler is reporting that it doesn't recognize the data type. The examples I have in my notes show a class where <string> was included in the class definition and a data member of type string was declared. I'm working on Microsoft Visual C++ 2008 Express Edition. If anyone could clarify why this wouldn't work I would really appreciate it. Thanks.
Last edited on Oct 24, 2009 at 1:48am
Oct 24, 2009 at 3:21am
How are you using it? Are you typing out std::string some_var; or just string some_var;?
Oct 25, 2009 at 1:01am
It was a foolish mistake, as usual. I was declaring it string some_var without the using standard namespace in my class definition.
Topic archived. No new replies allowed.