undefined symbol string


I started writing the following program

/ my first string
#include <iostream>
#include <string.h>
using namespace std;

int main ()
{
string mystring = "This is a string";
cout << mystring;
return 0;
}

when I started compiling, the copmpiler shows error at line 6 as "undefined
symbol string" may kindly elucidate.
Last edited on
'string' (and it's << operator) is defined in <string> not <string.h>
Topic archived. No new replies allowed.