user556761
user556761

Reputation: 261

how can i read a character if I have the initial pointer of that string

I have the initial pointer of the string how can read the value in character array from that string.

Upvotes: 0

Views: 71

Answers (1)

Shamim Hafiz - MSFT
Shamim Hafiz - MSFT

Reputation: 22094

const char *str="A C string";
printf("The first character is %c\n",*str);
printf("The second character is %c\n",*(str+1));

Upvotes: 3

Related Questions