B
Bernd Danberg
Hi,
I have a real strange problem with the command line arguments given to the
main-function and together with using std::string:
#include <string>
int _tmain(int argc, _TCHAR* argv[])
{
std::string str(argv[1]);
println(str.c_str());
}
When I call now this simple and small programm using the following
command-line argument: "C\:dir2html lang" then my string str holds
non-useful-data. When I delete the space or the backslash then the string
contains the correct value. Any ideas what I am doing wrong in converting
the argument from the main function argv[1] to my string-object
Thanks in advance,
Bernd
I have a real strange problem with the command line arguments given to the
main-function and together with using std::string:
#include <string>
int _tmain(int argc, _TCHAR* argv[])
{
std::string str(argv[1]);
println(str.c_str());
}
When I call now this simple and small programm using the following
command-line argument: "C\:dir2html lang" then my string str holds
non-useful-data. When I delete the space or the backslash then the string
contains the correct value. Any ideas what I am doing wrong in converting
the argument from the main function argv[1] to my string-object
Thanks in advance,
Bernd