Hey guys I need a little help, Well I am trying to use the string class in Dev C++ 4.9.7.0 but I can't get it to work, I have included the string.h (#include <string>) and also copied the include files in the "C:\Dev-Cpp\include\c++\mingw32\bits" in to the C:\Dev-Cpp\include\c++\bit\" driectory but it sitll don't recognise the type string, basic_string or String. Please if anyone can help I would be really greatful thanks.
Charles
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-01-28
The type is "string" all lower case not "String".
BTW: Copying the headers from mingw32/bits is a bad idea, and may cause problems if you upgrade - you will end up using the old files you copied rather than any updated ones in the mingw32 folder. The correct solution is to add "C:\Dev-Cpp\include\c++\mingw32\" to the default paths for projects.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey guys I need a little help, Well I am trying to use the string class in Dev C++ 4.9.7.0 but I can't get it to work, I have included the string.h (#include <string>) and also copied the include files in the "C:\Dev-Cpp\include\c++\mingw32\bits" in to the C:\Dev-Cpp\include\c++\bit\" driectory but it sitll don't recognise the type string, basic_string or String. Please if anyone can help I would be really greatful thanks.
Charles
The type is "string" all lower case not "String".
BTW: Copying the headers from mingw32/bits is a bad idea, and may cause problems if you upgrade - you will end up using the old files you copied rather than any updated ones in the mingw32 folder. The correct solution is to add "C:\Dev-Cpp\include\c++\mingw32\" to the default paths for projects.
If the problem still exists: Post your code so we can see what you did and mabe find the error, or at least copy it and try it.
Again - have you added using namespace std; after includes?
Eg:
#include <iostream>
#include <string>
using namespace std;
???
(I'm just asking...)