Hello
I have the following pointer
char **pOutData;
This contains an array of strings.
How do i printf each element in of pOutData
Hope someone can help
best regards
Hello
I have the following pointer
char **pOutData;
This contains an array of strings.
How do i printf each element in of pOutData
Hope someone can help
best regards
Assuming you're using an explicit size variable to store the number of strings:
int i;
for ( i = 0; i < n; i++ )
printf ( "%s\n", pOutData[i] );
A common alternative is using a null pointer as a sentinel. In that case, it would look like this:
char **p = pOutData;
while ( *p != NULL )
printf ( "%s\n", *p++ );
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.