I know this should be easy but I can't figure it out, how can I convert a char* to a char[] array? I'm not using CLR or MFC.

Here's what I have so far, using main ( int argc, char* argv[] )



char inchar[33];
char tempchar = 'a'; /* dummy value to start */
int count = 0;

while ( tempchar != '\0' )
{
tempchar = argv[1][count];
inchar[count] = tempchar;
count = count + 1;
}

fprintf(stdout, inchar);



When I run it like PROG.EXE DOG

I get only D as the output ( the first character only every time ).