talldudeX Posted September 7, 2002 Share Posted September 7, 2002 Yep, that's me...a C++ newbie...and I'm already having problems. Whenever I try to compile a simple hello world program, it doesn't work for some reason. Yes, I do have a compiler. #include <iostream.h> int main() { cout << "Hello world!\n"; return 0; } Can anyone help me out here? Anyone know where to find some good C++ tutorials or games? Thanks! Link to comment Share on other sites More sharing options...
SuicidalXWing Posted September 7, 2002 Share Posted September 7, 2002 I believe you've palced the quote in the wrong place. It goes directly after the ! or the return may have to go after the second } I'm not completely sure, I haven't coded in C++ since like January, and the summer tends to reformat my brain. Link to comment Share on other sites More sharing options...
Kuuki Posted September 7, 2002 Share Posted September 7, 2002 int main() { cout <<"Hello world!" << endl; return(0); } btw the C++ program should already have a compiler built into the software that you use to make the code.... Link to comment Share on other sites More sharing options...
SuicidalXWing Posted September 7, 2002 Share Posted September 7, 2002 That's true, but then again it also depends on the version of C++ on how the program reacts Scar. Link to comment Share on other sites More sharing options...
talldudeX Posted September 7, 2002 Author Share Posted September 7, 2002 I don't really think the code is the problem. I've even purposely screwed up the code to see what would happen, and the same thing always happens. It says there was an error and could not compile it. Link to comment Share on other sites More sharing options...
Kuuki Posted September 7, 2002 Share Posted September 7, 2002 well you didnt have any problem with your code its just the return statement was a little off Link to comment Share on other sites More sharing options...
SuicidalXWing Posted September 7, 2002 Share Posted September 7, 2002 that's it its the parenthesis () are important Link to comment Share on other sites More sharing options...
Jared Posted September 7, 2002 Share Posted September 7, 2002 Originally posted by talldudeX Yep, that's me...a C++ newbie...and I'm already having problems. Whenever I try to compile a simple hello world program, it doesn't work for some reason. Yes, I do have a compiler. #include <iostream.h> int main() { cout << "Hello world!\n"; return 0; } Can anyone help me out here? Anyone know where to find some good C++ tutorials or games? Thanks! sounds like a personal problem:D Link to comment Share on other sites More sharing options...
talldudeX Posted September 8, 2002 Author Share Posted September 8, 2002 Smartass Link to comment Share on other sites More sharing options...
Ewok Hunter Posted September 8, 2002 Share Posted September 8, 2002 hmm, do you really[/b need to move to the next line, why not just remove the /n and see if that helps? Link to comment Share on other sites More sharing options...
SuicidalXWing Posted September 8, 2002 Share Posted September 8, 2002 the () are what is keeping it from compiling, trust me and Scar on this. We did C++ coding a few months back. Link to comment Share on other sites More sharing options...
Kuuki Posted September 8, 2002 Share Posted September 8, 2002 Originally posted by Ewok Hunter hmm, do you really[/b need to move to the next line, why not just remove the /n and see if that helps? [/b] yeah you dont need to move to the next line at all, but it really dont matter cus there isnt anything else being outputed BUT!! are you putting in the #include <iostream.h> in the beginning of your code cus cout will only work with that header file Link to comment Share on other sites More sharing options...
SuicidalXWing Posted September 8, 2002 Share Posted September 8, 2002 yeah, he is. go to the first post, that's his exact code. Link to comment Share on other sites More sharing options...
Kuuki Posted September 8, 2002 Share Posted September 8, 2002 nevermind then! im just getting teird Link to comment Share on other sites More sharing options...
SuicidalXWing Posted September 8, 2002 Share Posted September 8, 2002 Sleep is for the weak. *smacks Scar a few times* Link to comment Share on other sites More sharing options...
Kuuki Posted September 8, 2002 Share Posted September 8, 2002 sorry im a Mansochrist, so pain does not affect me. but rest is im afrid something i do need, unlike you, which pain effects your judgement, emotion and proformence... ...human. Link to comment Share on other sites More sharing options...
SuicidalXWing Posted September 8, 2002 Share Posted September 8, 2002 Um, its masochist, if you truly were one, you'd know that. And I haven't eaten in days, who's the weak one? You require nutrients and sleep to survive, I require nothing. Link to comment Share on other sites More sharing options...
Kuuki Posted September 8, 2002 Share Posted September 8, 2002 how bout this: you let me beat you or ill have my people send out little increminating photographs of ya... Link to comment Share on other sites More sharing options...
SuicidalXWing Posted September 8, 2002 Share Posted September 8, 2002 considering I'm never in photographs, you're gonna have a lot of trouble. Besides, I gave all your little buddies pay raises to beat you into a bloody pulp. Link to comment Share on other sites More sharing options...
Cal_da_Darth Posted September 8, 2002 Share Posted September 8, 2002 Can someone just list the full working code for him? Link to comment Share on other sites More sharing options...
talldudeX Posted September 8, 2002 Author Share Posted September 8, 2002 I don't think you understand. I didn't write this code myself, I got it from Sams Teach Yourself Visual C++ in 21 days. Guess I should have mentioned that. Scarface, I tried your code, and it says there were 3 errors. Link to comment Share on other sites More sharing options...
SuicidalXWing Posted September 9, 2002 Share Posted September 9, 2002 int main() { cout <<"Hello world!" << endl; } return(0); This could be the code, if I had C++ installed, I could help ya out. Perhaps if ya truly can't figure it out, I'll break down and dig it out and install it. Link to comment Share on other sites More sharing options...
talldudeX Posted September 9, 2002 Author Share Posted September 9, 2002 Well I talked to a person today that is familiar with C++. They gave me the correct code and it still didn't work. I've come to the conclusion that there's something wrong with my compiler. Thanks for your help anyway, everybody. Link to comment Share on other sites More sharing options...
Kuuki Posted September 9, 2002 Share Posted September 9, 2002 mine should have worked just fine... Link to comment Share on other sites More sharing options...
SuicidalXWing Posted September 9, 2002 Share Posted September 9, 2002 Yeah, the compiler must be crap. What version of C++ you running? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.