Re: [Dev-C++] C++ strings in header files
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Daniel p. <dan...@st...> - 2005-09-07 09:17:13
|
Hi. you should use std::string instead for just string, or declarate "using std::string". if you use the second one then you will be able to use only string. using "using namespace std" is not to be recommended because it can cause a lot of problems in bigger programs. it should look like this: #include <string> using std::string string firstName; /Daniel Pettersson At 06:05 2005-09-07, Alfred P. Reaud wrote: >Hi Dane, > >Could be that you haven't included "using namespace std;" above your include. > >Dane Ensign <dg...@wo...> wrote: >Hi all, > >I want to place 2 string members in my class .h file. Currently I >have put '#include ' at the top and as a private member >I put: > >string firstName; > >When I try to compile I get this error: 'string' does not name a type. > >Please can someone show me how to do this properly? > >Best regards, > >Dane >da...@de... > > > ><mailto:al...@ya...>Alfred P. Reaud ><http://www.geocities.com/alreaud/> >[] > |