Hi, I'm new to C and I have a little problem with scanf funktion.
It seems that I only can get everything before a spece(if if exist) and the text after it.
eg
char text[30];
printf ("Enter some text"
;
scanf("%s", &text);
printf("\nYou wrote %s\n", text);
If I run this program och after the "Enter some text" prompt writes "Hello dude" it will only print out
"You wrote Hello"
How do I do if I want to print out all including the white spaces ??
Thanks
///Fredrik
It seems that I only can get everything before a spece(if if exist) and the text after it.
eg
char text[30];
printf ("Enter some text"
scanf("%s", &text);
printf("\nYou wrote %s\n", text);
If I run this program och after the "Enter some text" prompt writes "Hello dude" it will only print out
"You wrote Hello"
How do I do if I want to print out all including the white spaces ??
Thanks
///Fredrik