Hello,
I am trying to define a variable of type string, however the compiler does not like it.
I've done #include <string>.
I'm using the Bloodshed compiler. The include files are there. Please help.
Hello,
I am trying to define a variable of type string, however the compiler does not like it.
I've done #include <string>.
I'm using the Bloodshed compiler. The include files are there. Please help.
Try adding this line after the includes:
Code:using namespace stl;
Thanks for the quick reply. That did not work however. It did not like that line of code. Also, I already had the line:
Code:using namespace std;
Could you post the code with the errors you got? That'll make it easier for us to help you out.
Here it's just a simple test trying to get the string to work.
Error: 'string' undeclaredCode:#include <iostream> #include <string> int main() { string test; return 0; }
What version of Dev-Cpp are you using? I don't think they updated to the new C++ standard until the 5.0 beta.
I'm using 4.9.9.1
I just downloaded it from their website. It was the most recent one.
You need to declare the namespace you're using by adding std:: before the type declaration.Code:#include <iostream> #include <string> int main() { std :: string test; return 0; }