C examples for String:char array
Use char pointer to access string constants
#include <stdio.h> #include <string.h> char *p = "hello world"; int main(void) { register int t; /* print the string forward and backwards */ printf(p);/* w w w. j a v a2 s . co m*/ for (t = strlen(p) - 1; t>-1; t--) printf("%c", p[t]); return 0; }