星期五, 九月 28, 2007

解决问题 “error: `cout' was not declared in this scope”

code is:

#include <iostream>

int main(int argc, char *argv[])
{
cout << "hello world" << endl;
}

when compile the erro info is below:

test@kenshinxf ~/sutdy $ g++ scat.cpp -o scat

scat.cpp: In function `int main(int, char**)':
scat.cpp:12: error: `cout' was not declared in this scope
scat.cpp:12: error: `endl' was not declared in this scope

the reason is :

This is becuase C++ 1998 requires cout and endl be called
'std::cout' and 'std::endl', or that a proper using directives such as
'using namespace std;' be used.

#include <iostream>

int main(int argc, char *argv[])
{
std::cout << "hello world" << std::endl;
}

or

#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
cout << "hello world" << endl;
}


24 意見:

匿名 说...

buy tramadol online is tramadol for dogs an nsaid - buy tramadol online in usa

匿名 说...

order xanax online mastercard xanax online no prescription - xanax overdose treatment

匿名 说...

buy tramadol online tramadol 100 mg side effects - tramadol withdrawal flu like symptoms

匿名 说...

generic xanax generic xanax green - best generic xanax manufacturer

匿名 说...

buy tramadol online legal buy tramadol online usa - order tramadol online overnight delivery

匿名 说...

carisoprodol 350 mg carisoprodol narcotic drug - carisoprodol online no prescription

匿名 说...

buy cialis online cialis daily kaufen - generic cialis in us

匿名 说...

buy tramadol online buy 100mg tramadol online - buy tramadol online without prescriptions

匿名 说...

buy xanax valium online florida xanax bars for sale in mexico - xanax 555 imprint

匿名 说...

buy cialis online cialis - generic cialis potency

匿名 说...

buy tramadol tramadol hydrochloride 50 mg high - tramadol 50 mg half life

匿名 说...

buy tramadol tramadol for dogs how long does it take to work - tramadol 50 mg rx list

匿名 说...

buy tramadol online no prescription overnight tramadol muscle relaxer - tramadol 50 mg kaps ratiopharm

匿名 说...

http://buytramadolonlinecool.com/#59473 tramadol dosage with paracetamol - tramadol hcl used for depression

匿名 说...

http://landvoicelearning.com/#51438 tramadol withdrawal heart palpitations - what's maximum dosage tramadol

匿名 说...

buy tramadol online pharmacy tramadol cheap - tramadol withdrawal after one week

匿名 说...

buy tramadol online tramadol hcl drug classification - tramadol snort

匿名 说...

http://landvoicelearning.com/#57594 tramadol hcl 50 mg addiction - where to buy tramadol cod

匿名 说...

buy tramadol cod fedex best way buy tramadol online - tramadol cream

匿名 说...

ways to buy ativan online ativan jet lag - ativan online purchase

匿名 说...

ways to buy ativan online ativan dosage chart - many 1mg ativan overdose

匿名 说...

http://reidmoody.com/#92465 lorazepam 1mg (ati) - ativan side effects mayo clinic

匿名 说...

http://staam.org/#21236 tramadol hcl 50 mg street value - buy tramadol overnight delivery

匿名 说...

buy tramadol online tramadol hcl 50 mg para que sirve - tramadol hcl 50mg for dogs