How to convert argument to string?

I wonder why I cannot convert the a to string:

1
2
3
4
5
6
7
8
MyGlobalClass::MyGlobalClass(int argc, _TCHAR **argv){
	_TCHAR *a;
	for(int i = 0; i < argc; i++)
	{
		a = argv[i];
		std::istringstream ss((string) a);
	}
};


I also tried to add
a = argv[i] . "\0";
however this also failed. Can you explain why and how to do it, if it is possible?
Last edited on
1) _TCHAR* is at best a C-style string. Casting it to a string will not work; I think you mean to simply construct one.
2) The '.' operator doesn't concatenate strings in C++. You must use '+', and even then that will only work for std::strings, not C-style pointers.
Topic archived. No new replies allowed.