I have a strange problem, simple program, f.e.
main()
{
int i=1;
std::cout << i;
}
Results with
1%
on screen. I can't get rid of that "%". Does anyone know what is going on? I am using g++ (GCC) 4.8.0 20130502 on Arch Linux.
I have a strange problem, simple program, f.e.
main()
{
int i=1;
std::cout << i;
}
Results with
1%
on screen. I can't get rid of that "%". Does anyone know what is going on? I am using g++ (GCC) 4.8.0 20130502 on Arch Linux.
The '%' is not from the program - It is from the shell that you are running it from.
Try
std::cout << i << std::endl;
Is the %
your shell prompt?
If so, change your cout
line to
std::cout << i <<'\n';
Run echo $PS1
in your shell to see what's your prompt.
Your original program prints 1 & then the shell prints the %
prompt.