I am a newbie on c++
I am creating a console application that has some value in string and using Console::Writeline it will display this value, following is the sample code i am using.
std::string response;
Console::WriteLine(response);
Plz help
Printable View
I am a newbie on c++
I am creating a console application that has some value in string and using Console::Writeline it will display this value, following is the sample code i am using.
std::string response;
Console::WriteLine(response);
Plz help
What help are you looking for?
std::string and Console::WriteLine() don't easily mix. This one compiles with just a compiler warning (C4800):
But it certainly won't do what you expect. (If you're curious, just try it... :D)Code:Console::WriteLine(response.c_str());
It generally is no good idea to mix the C++ standard library with the CLR infastructure without a real need to do so.