I’m a novice on C++, and I failed to run my first C++ program, the code is
#include <iostream.h>
void main()
{
cout>>"Hello world!">>endl;
}
but it failed to print "Hello world!" on the console, I’m confused on this issue for hours, and there seems not wrong with the configuration, I’m using Visual C++ 2010 Express and it’s the basic console project format, can anyone help me?
You have your direction wrong.
Think of
<<as pushing data intocout, i.e. the output.Inversely, you use
>>withcinto push data into a variable, from input.