C examples for String:char array
Read from console and Store Strings using a pointer to char and a char type array
#include <stdio.h> int main()//from w ww .j av a 2s . c om { char name[8] ; char *pname; printf("\nEnter name: "); scanf(" %[^\n]", name); printf("Enter name again: "); scanf(" %[^\n]", pname); printf("name: %s\n", name); printf("pname: %s\n", pname); return(0); }