如果我有该字符串的初始指针,我怎么能读取一个字符

时间:2011-03-01 05:46:16

标签: c

我有字符串的初始指针如何从该字符串中读取字符数组中的值。

1 个答案:

答案 0 :(得分:3)

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