![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | ||
|
Programming Guru
![]() ![]() |
Hey,
i havn't programmed in c++ for a while so last night i desided to just fool around for a while. First i just started making a simple hello world programm to get back in the swing of things. Here's the code...just wait i am getting to the question bare with me. #include <iostream>
int main()
{
cout << "Hello World" << endl;
return 0;
}Anyways, it looks alright....right? When i try to compile it useing the command: Quote:
Quote:
-Pizentios
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
||
|
|
|
|
|
#2 |
|
PFO Founder
![]() ![]() |
the problem that i am seeing is that you are trying to compile a c program but you are writing a c++ program you woudlnt use gcc you would use something else i cant think of it off the top of my head if i come up with it later i will post it. and another thing you mite want to save the file as .cpp that mite help you out there too.
edit. well i think the command for compiling a c++ program would be g++ but im not sure i didnt run the command to check but try that out and see what you get good luck
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
|
|
#3 | |
|
Programming Guru
![]() ![]() |
Hey,
I tryed the command: Quote:
-Pizentios
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
|
#4 |
|
PFO Founder
![]() ![]() |
well i got it to work by adding a bit of code all i added was this
using namespace std; ![]() so this is the code you would have #include <iostream>
using namespace std;
int main()
{
cout << "Hello World" << endl;
return 0;
}g++ -o test test.cpp good luck
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
|
|
#5 |
|
Programming Guru
![]() ![]() |
Thanks for the help. I don't ever remember using that in c++. oh, well it works so i an't going to complain. Thanks once again.
-Pizentios
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
#6 |
|
PFO Founder
![]() ![]() |
no problem
i love to help. even when i dont know the language ![]()
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
|
|
#7 |
|
Newbie
|
the "using namespace std;" line is part of the C++ standard... the old way is still seen, but very much deprecated... you should pick up a book on standard C++ just to get up to speed on what they've adopted/changed/added to C++ during the standardization process.
__________________
int main{ int count; for(count=0;count<99;count++){ printf("I will not throw paper airplanes.\n");} } |
|
|
|
|
|
#8 |
|
Programming Guru
![]() ![]() |
cool, i didn't know that. thanks for the info. know any good sites with this info on them? Just so i don't have to spend money.
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
#9 |
|
Newbie
|
not off the top of my head... i got that from Herbert Schildt's "Teach Yourself C++"
__________________
int main{ int count; for(count=0;count<99;count++){ printf("I will not throw paper airplanes.\n");} } |
|
|
|
|
|
#10 |
|
Newbie
Join Date: Jun 2004
Location: Nottingham, England, UK
Posts: 2
Rep Power: 0
![]() |
I'd recommend Bjarne Stroustrup's "The C++ Programming Language, 3rd Edition" for an in-depth, up-to-date and comprehensive guide to C++. I used it both to learn the advanced features (I already knew the basics of C++ before buying that book) and as a reference to any part of the language you care to mention. It contains a few chapters on the STL containers and algorithms, with a more indepth look at strings and streams. In all, a very useful book.
http://www.amazon.com/exec/obidos/tg/detai...=glance&s=books |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|