Using this [^] (^ caret Symbol ) we can get the input till the character from the keyboard....

for Example....

U can get a line(Till \n is reached) by using Scanf insted of gets();
U can give any character [^ #] ....[^_]


char *a=(char*)malloc(sizeof(char));
scanf("%[^\n]",char);