Yet another question!
I've been playing with my own tournament manager program.
When reading in the player names from a .ini file, using fgets()
Code: Select all
while(fgets(readinput , 512 , ini_file))
{
etc...
Each name is read in with a "\n" on the end.
So, when I come to write
"Player 1 vs Player 2"
to a file, it reads
"Player 1
vs Player 2"
How do I remove the "\n" from the end of the 'Player 1\n' ?
I have tried
Code: Select all
char game[256]
strcpy(game,player[0]);
strcat(game," v ");
strcat(game,player[1]);
I've been hunting cplusplus.com for a while now, and no answer. It seems a simple problem?
Thanks!
Richard