how to make it working correct(libstdc++)?

Christoph Bugel chris@tti-telecom.com
Mon Aug 12 01:49:00 GMT 2002


> From: TARZAN LION <tarzanboy@21cn.com>
> To: libstdc++@gcc.gnu.org

> #include <iostream.h>
> #include <string.h>
> 
> int main()
> {
>   string str("hello world!");
>   cout<<str<<endl;
>   return 0;
> }

Your program doesn't work with modern C++ compilers,
You should write it this way:
(BTW, this question belongs in the gcc help mailing list)


#include <iostream>
#include <string>
using namespace std;

int main()
{
  string str("hello world!");
  cout<<str<<endl;
  return 0;
}




More information about the Libstdc++ mailing list