Sankha Subhra Som wrote:
And btw Manish's suggestion that i flush the buffer using endl works. But i have to manually flush it everytime i use a cout. This sucks.Ne pointers Manish?
Yes -- if this sucks so much, write a wrapper over your cout call that will always append a newline (endl) to your output. Do you know how operator overloading works? Do you know about streams in C++? Create your own thin-wrapper output stream with the << operator overloaded to append endl in each call. This is not essential but a good exercise for character building.
In short, GET A BOOK and LEARN C++!
-mj