-2
int main()

{

char s[100];

char s1[] ={"Hello, World!"};

scanf("%[^\n]%*c", s); // The statement that we are interested in//

printf("%s",s1);

printf("\n");

printf("%s",s);

return 0;

}
Some programmer dude
  • 400,186
  • 35
  • 402
  • 621

1 Answers1

1

There are already some post about this argument, such as this. By the way:
with %[^\n] you are taking input until a newline isn't encountered. With %*c you take the newline character and then discard it (this is useful when you are using fgets after scanf).