Skip to main content

Thread: c++ g++ in 10.04 lucid


i'm trying learn basic c++, can't hello, world! work. here's i'm entering in gedit (or whatever it's called):

#include <iostream>

int main ()
{|
cout << "hello, world!";
return 0;
}


, here's when enter g++ hello.cpp -o test in terminal:

hello.cpp:4: error: expected primary-expression before ‘|’ token
hello.cpp:5: error: ‘cout’ not declared in scope


doing wrong? suggestions on how make work? i've followed few different guides on how this, and, no matter what, first error. (the second 1 new.) please halp!

edit: of other ones i've tried include colons , mysterious lower case l, can't find templates now.

what says - g++ expects before | sign, why there? std::cout if havent specified namespace (using namespace std)


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu] c++ g++ in 10.04 lucid


Ubuntu

Comments

Popular posts from this blog

CS5 Adobe Media Encoder: Encode failed because the source duration is nil.

cf_sql_integer vs cf_sql_bigint vs cf_sql_int??

localhost/joomla15/administrator doesnt work - Joomla! Forum - community, help and support