Code: Select all
#include <iostream>
#include <stdlib.h>
#include <string>
int main(int argc, char *argv[])
{
string mystring;
mystring = "abcdef";
cout << mystring[2] << endl;
return 0;
}
C:\Documents and Settings\Administrator\Desktop\C++ stuff\main.cpp In function `int main(int, char**)':
6 C:\Documents and Settings\Administrator\Desktop\C++ stuff\main.cpp `mystring' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
7 C:\Documents and Settings\Administrator\Desktop\C++ stuff\main.cpp `cout' undeclared (first use this function)
7 C:\Documents and Settings\Administrator\Desktop\C++ stuff\main.cpp `endl' undeclared (first use this function)
C:\Documents and Settings\Administrator\Desktop\C++ stuff\Makefile.win [Build Error] [main.o] Error 1
im not sure whats wrong with this... please help thank you