Hi,
I'm quite new to C/C++ programming, and I'm having some problems when trying to create variables of type string.
Here's a little example code:
Now, previously I've been using Dev-C++ 5 beta as my IDE, but after numerous problems I decided to roll back to version 4, and all my previous problems have gone. I've also tried MS Visual C++ (Express), but it wasn't right for the relatively small progs I'm making at the moment.Code:#include <iostream.h> #include <stdlib.h> using namespace std; int main() { string myString = "This is my string." cout << myString system("PAUSE"); return 0; }
With version 4, the only problem I've encountered so far is that the compiler doesn't seem to want to accept "string" as a data type. Any ideas of what I can do or what the problem may be?
I'm using Bloodshed Dev-C++ as my IDE, which comes with Mingw as the compiler.
I'm running XP, and my compilation errors are:
`string' undeclared (first use this function) (line 7)
parse error before `=' (line 7)
Any help would be greatly appreciated.
Thanks for your time.