Example if user enters:
My name is James.
Using scanf, I have to print the full line, i.e. My name is James., then I have to get t
Try:
scanf("%80[^\r\n]", string);
Replace 80 with 1 less that the size of your array. Check out the scanf man page for more information