DS
2010-01-27 23:12:17 UTC
Hi,
I am troubled...
I would like to declare a pointer to an array of char pointers, that
I can allocate at some time during a run.
I'll expect a variable length string of tokens seperated by white space chars.
I would like to search for each token head and store it's address in a sequential
array of pointers, Then insert a NULL at each tokens end.
ie: string = "Cmd Arg1 Arg2 Arg3..."
Now I tried:
char ** PtrArray;
But the program hanged.
char * PtrArray[];
The declaration compiled but I get errors on:
if ( PtrArray == (char *[]) NULL)
or if( PtrArray == (char *)NULL
char * PtrArray[1];
The declaration compiled but I get errors on:
if ( PtrArray == (char *[]) NULL)
or if( PtrArray == (char *)NULL
I have turned my "C Reference Manual inside and out.
I have read several web documents, pointer tutorials...
Please help,
Dan
I am troubled...
I would like to declare a pointer to an array of char pointers, that
I can allocate at some time during a run.
I'll expect a variable length string of tokens seperated by white space chars.
I would like to search for each token head and store it's address in a sequential
array of pointers, Then insert a NULL at each tokens end.
ie: string = "Cmd Arg1 Arg2 Arg3..."
Now I tried:
char ** PtrArray;
But the program hanged.
char * PtrArray[];
The declaration compiled but I get errors on:
if ( PtrArray == (char *[]) NULL)
or if( PtrArray == (char *)NULL
char * PtrArray[1];
The declaration compiled but I get errors on:
if ( PtrArray == (char *[]) NULL)
or if( PtrArray == (char *)NULL
I have turned my "C Reference Manual inside and out.
I have read several web documents, pointer tutorials...
Please help,
Dan