get size of char* c code example
Example 1: c print sizeof char
char b = 'b';
printf("the size of b is %d",sizeof(b));
Example 2: accessing the elements of a char* in c
#include <stdio.h>
int main()
{
char *p="abcd";
printf("%c\n", p[0]);
printf("%c\n", p[1]);
printf("%c\n", p[2]);
printf("%c\n", p[3]);
return 0;
}