Jump to content
  • Advertisement
Sign in to follow this  
swordance

c++ language

This topic is 5086 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
IIRC, which I probably don't, you can compile for either .net or for straight C++. Compiling for .net means you need the .net libraries inorder to run your program, but in exchange you get extra functionality.

Share this post


Link to post
Share on other sites
this will compile in .net, but not in regular C++


for (int i=0; i<5; i++){

}
for (int i=0; i<5; i++){

}



in regular, the variable i is not destroyed so you get errors when redefining it. I really hated that too.

Share this post


Link to post
Share on other sites
Quote:
Original post by Lee_
this will compile in .net, but not in regular C++

*** Source Snippet Removed ***

in regular, the variable i is not destroyed so you get errors when redefining it. I really hated that too.

That is not "regular" C++, that is the bastardized version of C++ that visual studio 6.0 uses. As it was written in 1997 before the standard was finalized (1998). If you are still using 6.0, upgrade. You can get the CLI compiler toolkit free from microsoft, or get a better IDE entirely for about $100. If you wait a while though, 2k5 will be released, and that's even better.

Share this post


Link to post
Share on other sites
Quote:
Original post by Lee_
this will compile in .net, but not in regular C++

*** Source Snippet Removed ***

in regular, the variable i is not destroyed so you get errors when redefining it. I really hated that too.
That will compile in most c++ compilers, it's just vc 6.0 that sucks.

Share this post


Link to post
Share on other sites
Quote:
Original post by Lee_
6.0 for sure, I don't know about the others.. never used them.


This one has benn corercted in VC.NET versions.

To get rid of this problem using VC6, just add


#define for if (1) for


in your stdafx.h header.

HTH

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!