In my code:
scanf("%s", &text);
printf("%s\n", text);
Input:
hi how are you
Output:
hi
and not
hi how are you
what can I do to fix it?
In my code:
scanf("%s", &text);
printf("%s\n", text);
Input:
hi how are you
Output:
hi
and not
hi how are you
what can I do to fix it?
Use fgets to get your input:
Look at fgets
I suppose you're looking for
Which will read up to a newline delimiter. Or if you're using some other delimiter