Jump to content

Home

C++ Newbie


talldudeX

Recommended Posts

Posted
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 :p).

 

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. ;)

Posted

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?

Posted
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 :p).

 

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()

Posted

#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 :D 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...

Posted

Borland Delphi? AAAAAAAAAAAAAAAAAAAAAAH i hate that program..... maybe because i realy suck at it :D./....... i still have to learn that program for school.... or else i will fail my education:(

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...