Web lists-archives.org

Re: [Mingw-users] Problem with string object on mingw.




I see, thank you.

2008/5/14 Greg Chicares <gchicares@xxxxxxxxxxxxx>:
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

-------------------------------------------------------------------------
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