Jump to content
  • Advertisement

Archived

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

cybersniper

c++

This topic is 5584 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Guest Anonymous Poster
Here is the c++ program you requested:

int main(void)
{
return 0;
}

Enjoy.

Share this post


Link to post
Share on other sites
Ummm. First, C++ is not a program, it's a language. You use the C++ langauge in addition to some other tools to make programs. Second, I'm assuming you want/need a compiler, which is a tool to convert your code into machine langauge (binary). There are several compilers out there. You didn't specify an OS, but...
Windows:
Microsoft Visual C++
Borland Compiler Turbo?
DGJPP <-- Free
DevC ?

Linux <- There are some compilers that come with the OS
Maybe someone could list some. I've had very little experience with Linux (non-programming)

Mac OS:
Apple bundles a compiler with their OS called Project Builder
and Also a compiler called CodeWarrior from another company.

Third you probably want a book. I can't recommend what the best C++ programming book is, because I don't have any that would qualify. Well there is one, but it's more of a reference.

I have:
Learn C++ in 24 Hours <-- DO NOT BELIEVE THE TITLE
C++ for Dummies <--- DO NOT TAKE THE TITLE SERIOUSLY
C++ The Complete Reference 3rd Edition <-- A book for people with C++ experience

Theres a college C++ book from Deitel and Deitel. Can't remember the name though. It's pretty good.


I don't have a signature

[edited by - Brian Jones on February 6, 2003 9:49:03 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Anonymous Poster
Here is the c++ program you requested:

int main(void)
{
return 0;
}

Enjoy.

I think this is better though:

int main()
{
}

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Anonymous Poster

I think this is better though:

int main()
{
}



Why because it won''t compile?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Anonymous Poster
Here is the c++ program you requested:

int main(void)
{
return 0;
}

Enjoy.


But we might aswell help him out with standard C++ if we''re going to give him examples.

Main does NOT take void as an argument and it doesn''t HAVE to return anything.

Cheers.

Share this post


Link to post
Share on other sites
if you declare

int main()
{
}

it HAS to return an int, because you are saying it will!!!

int <-return type main <-Function name ()<- Parameters



void main()
{
}

is correct though, because you are saying we are returning nothing!

Share this post


Link to post
Share on other sites
Hello,

This could lead to one of the most interesting discussions in a long time. Who want:
int main()
{
return 0;
}

who wants:
int main()
{
}

and who wants:
void main()
{
}


Regards,
Deficte

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!