-4

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 ?

Paul R
  • 202,568
  • 34
  • 375
  • 539

1 Answers1

2

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" );
}
Vlad from Moscow
  • 265,791
  • 20
  • 170
  • 303