convert const char to std::string
-
After decades of fun we now have to stop using MFC in the project. How do I get this to work? I want a simple solution, because I have this about 1000 times in the code. I tried those answers which seemed obvious to me, but it does not compile. const char CODE_N = 'N'; string SK::getCode() const // was CString { return CODE_N; } 1>..\path\SK.cpp(1423) : error C2440: 'initializing' : cannot convert from 'const char' to 'std::basic_string<_Elem,_Traits,_Ax>'
------------- Bibo ergo sum
-
After decades of fun we now have to stop using MFC in the project. How do I get this to work? I want a simple solution, because I have this about 1000 times in the code. I tried those answers which seemed obvious to me, but it does not compile. const char CODE_N = 'N'; string SK::getCode() const // was CString { return CODE_N; } 1>..\path\SK.cpp(1423) : error C2440: 'initializing' : cannot convert from 'const char' to 'std::basic_string<_Elem,_Traits,_Ax>'
------------- Bibo ergo sum
Check this article[^], things will be much clearer afterwards.
Cédric Moonen Software developer
Charting control [v1.5] OpenGL game tutorial in C++ -
Check this article[^], things will be much clearer afterwards.
Cédric Moonen Software developer
Charting control [v1.5] OpenGL game tutorial in C++