Replies To: Why ~ Appers At Output?

Re: Why ~ Appers At Output?

What exactly do you mean by cleanup? Completely remove all whitespace? Why read in a character at a time? Look at line 27 and tell me whats wrong with it? line[i] == '\0';

Your problem is with how you handle newlines. getline should only read in a line, so when you hit \n, you really only need to break out of the loop. Once out of the loop, setting line[i] = '\0' replaces the \n with the NULL character.

This post has been edited by vividexstance: 24 January 2013 - 09:45 AM