Devil Doll Posted September 9, 2002 Share Posted September 9, 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! I´m not a C++ master, but i´ll try to give you an advice: Always use this: void main() you write int main() and not void main() if you never put a void main in you c++ program it will never compile cause it is the principal sentence (include iostream too ). int is to declare any integer value, and you are declaring the principal main as an integer, only change the int into a void and maybe it will work. Link to comment Share on other sites More sharing options...
Ewok Hunter Posted September 10, 2002 Share Posted September 10, 2002 oh, forgot about that:rolleyes: well here's what the idiots guide says #include <iostream.h> main() { cout<<"hello ect."; return(0); } Link to comment Share on other sites More sharing options...
talldudeX Posted September 10, 2002 Author Share Posted September 10, 2002 Psh. It finally decided to give this message. "Error: No compiler associated with program." Well what the hell. I downloaded the borland C++ compiler. How do I make C++ and my new compiler work together? Link to comment Share on other sites More sharing options...
Kuuki Posted September 10, 2002 Share Posted September 10, 2002 Originally posted by Devil Doll I´m not a C++ master, but i´ll try to give you an advice: Always use this: void main() you write int main() and not void main() if you never put a void main in you c++ program it will never compile cause it is the principal sentence (include iostream too ). int is to declare any integer value, and you are declaring the principal main as an integer, only change the int into a void and maybe it will work. thats why you use a return statement when you int main() Link to comment Share on other sites More sharing options...
LukA_YJK Posted September 10, 2002 Share Posted September 10, 2002 #include <iostream.h> int main() { cout << "Hello world!\n"; return 0; } talldudeX your code is just OK ! It's not true that main should be void... and Borland Turbo C++ is the best ever compiler for DOS. Your error is an environment error, I think. You should check out Options/Directories for all directories are correct. Hope it will help. By the way, I am very glad that somebody asked a question about programming I posted once a call to all Rogues for starting learn programming so we can realize our plans togather. I am not a C hacker, but I know Pacal a bit and used Borland Delphi to make all my utilities. Borland is the best, the Force is with them indeed Try http://www.experts-exchange.com you can ask there any question. I'm also there in Delphi Section. Also please ask your specifical programming questions in Gold Squadron forum, I'll try to answer... Sorry, I'm out... Link to comment Share on other sites More sharing options...
Wraith 8 Posted September 10, 2002 Share Posted September 10, 2002 Borland Delphi? AAAAAAAAAAAAAAAAAAAAAAH i hate that program..... maybe because i realy suck at it ./....... i still have to learn that program for school.... or else i will fail my education:( Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.