Weird glitch/bug with c++ program compiled in Ubuntu? or am I doing something wrong?

Andrew McNabb amcnabb at mcnabbs.org
Wed Feb 15 15:25:21 MST 2012


On Wed, Feb 15, 2012 at 02:51:44PM -0700, John Shaver wrote:
> 
> Suddenly, in my program output, the first operand of each converted
> postfix statement was replaces with a space and I can't figure out
> why.   The weird thing though... The windows executable work just
> fine??

It looks like you're having a problem with line endings.  Your program
checks for a newline ('\n'), but it doesn't treat carriage return ('\r')
specially.  At some point, the program prints out the carriage return,
which on Linux causes all of the input on the line to be erased.

--
Andrew McNabb
http://www.mcnabbs.org/andrew/
PGP Fingerprint: 8A17 B57C 6879 1863 DE55  8012 AB4D 6098 8826 6868


More information about the PLUG mailing list