开发者

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

开发者 https://www.devze.com 2023-02-13 21:20 出处:网络
I have the initial pointer of the string how can read the value in character array from that stri开发者_JAVA技巧ng.const char *str=\"A C string\";

I have the initial pointer of the string how can read the value in character array from that stri开发者_JAVA技巧ng.


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

精彩评论

暂无评论...
验证码 换一张
取 消