Re: [Mingw-users] Problem with string object on mingw.
- Date: Wed, 14 May 2008 20:38:58 +0000
- From: Greg Chicares <gchicares@xxxxxxxxxxxxx>
- Subject: Re: [Mingw-users] Problem with string object on mingw.
On 2008-05-14 19:58Z, Rafael Anschau wrote:
> This code compiles with borland 5.5.1, but fails with g++ .The message I get
> is:
>
> `string' does not name a type
>
>
> #include<iostream.h>
> #include<string.h>
> #include<strings.h>
> #include<string>
>
> class Animal {
>
> string t;
>
> };
The C++ 'string' class template is in namespace 'std'. Instead of
> string t;
you can say
std::string t;
Alternatively, after including the <string> header but before
using 'string' in any of your code , you could write
using std::string;
to use just that one feature of the C++ standard library, or
using namespace std;
to use all names in 'std' without a 'std::' prefix.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users