Sankha Subhra Som wrote:
I have this peculiar problem with g++ under linux. This is a small piece of code that i wrote #include<iostream.h>
Make this <iostream>
Drop the .h. It's deprecated.
main() { cout << "blahblah"; }
cout is in the std namespace. So either you declare that you're using the namespace or you qualify cout with the namespace name. e.g.
std::cout << "blahblah";
To get a warning free compile i commented out the line
#include backward_warning from iostream.h
You don't need to screw with the standard library headers just to get your program to compile!
When i try to run the executable the shell does a silent return, without printing the blahblah as it is supposed to. I redirected the output to a file, and it contained blahblah.
Just guessing -- you probably need to flush the output stream. Appending an std::endl at the end should do it.
-mj