[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

C++/Hello, World!



Jeg er gået i gang med at (forsøge at) lære C++!
P.t. er jeg nået til lærebogens første eksempel - det legendariske "Hello, 
World!"

Programmet, som er skrevet direkte af fra lærebogen (af Bruce Eckel), ser 
således ud:

-------------------

#include <iostream> // Stream declarations
using namespace std;

int main() {
cout << "Hello, World! I am " << 8 << " Today!" << endl;
} ///;~

-------------------

Det er gemt som 'Hello.cpp', og ser ud til at kompilere OK - men når jeg vil 
køre det, sker følgende:

sslug@sslug:~> ./Hello.cpp
./Hello.cpp: using: command not found
./Hello.cpp: line 5: syntax error near unexpected token `main()'
./Hello.cpp: line 5: `int main() {'

Jeg kan ikke lige se, hvad problemet er - kan nogen hjælpe?

mvh
Hans


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *