I have pointer like this => char* str={"you","we","they"};
I want to take 'we' or "they" .how is it posible ?
can you sy something about pointer ?
I have pointer like this => char* str={"you","we","they"};
I want to take 'we' or "they" .how is it posible ?
can you sy something about pointer ?
It seems that you mean something like the following
char *str[] = { "you", "we", "they" };
for ( size_t i = 0; i < sizeof( str ) / sizeof( *str ); i++ )
{
puts( str[i] );
}
Or
char *str[] = { "you", "we", "they" };
for ( size_t i = 0; i < sizeof( str ) / sizeof( *str ); i++ )
{
for ( char *p = str[i]; *p != '\0'; ++p ) putc( *p );
printf( "\n" );
}