TCHAR *argv[]

I have a program that launches with the following cmd line.

parent.exe child.exe. 7 (Any number can be used)

The values are stored in TCHAR *argv[]

I cn print out the values using

printf(" %s\n", argv[0]);
printf(" %s\n", argv[1]);
printf(" %s\n", argv[2]);

and they show correctly on the screen.

I need to someway create a string from this info that would combine the values of argv[1] and argv[2] seperated by a space.

The result of the example above would be

"child.exe 7"

Is this possible.? Actual code examples are the most helpful.
1
2
3
4
TCHAR a[128]; // large enough?
_tcscpy(a, argv[1]);
_tcscat(a, " ");
_tcscat(a, argv[2]);

Last edited on
Thanks. Sorry for the delay.
Topic archived. No new replies allowed.