0

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

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by Narue
0

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++ );
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.