I want to print two strings that was an input from the user using fgets(). fgets() allowed me to store strings with spaces and terminating it with an enter. Following is the example code:
fgets(tTemp ->string, 51, stdin); fflush(stdin);
Now to print it out to the screen:
printf("%s", temp->string); printf(":%s", temp->string2);
//assuming there are 2 strings
I now want them to print on the same line with the format like this:
string:string1
however the result from the following codes were:
string
:string
how can I make the \n
from fgets to not show when I print to get the format I want?