i can't define a string - help

  • Thread starter Thread starter Jack
  • Start date Start date
J

Jack

#include <string>
#include <iostream>

int main(){
string s= "Application";

return 0;
}

What am i doing wrong, I get an error message saying 'string undeclared
identifier'. This used to work.
 
Jack said:
#include <string>
#include <iostream>

int main(){
string s= "Application";

return 0;
}

What am i doing wrong, I get an error message saying 'string undeclared
identifier'. This used to work.

Try

std::string s = "Application";

then look up name spaces in your favorite C++ reference.

Regards,
Will
 
Standard C++ library 101... Try std::string instead, or add a using
namespace directive after your includes: "using namespace std;"
 
C++/CLI:
String ^s = "Application";
or:
System::String ^s = "Application";
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
Instant Python: VB to Python converter
 
Back
Top