Could someone explain the following codes
#include<stdio.h>
main()
{
char c[]="abc\nabc";
puts(c);
}
This code as expected generates :
abc
abc
But when i try to take the same string as an input from the user,
#include<stdio.h>
main()
{
char c[]="abc\nabc";
gets(c); // i type in "abc\nabc"
puts(c);
}
This code generates :
abc\nabc
How can i make the program read the newline character correctly ?