When I print a string with printf
like in the following:
#include <stdio.h>
void main(void)
{
printf("Foo");
}
In the output, I get the following:
As seen in this picture, there is a highlighted percent sign placed after the output of printf
. What's causing this? How do I get rid of it?
That's your shell's prompt. You're not printing a newline after the string "Foo", so the prompt appears immediately after it.
Add a newline to the string to print so the shell prompt appears on a separate line.
printf("Foo\n");