Public Group

# c++ language

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

## Recommended Posts

when you program in c++.net do you use c++ language or does c++.net use the net language?

The first one.

##### Share on other sites
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 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 on other sites
regular meaning: ANSI C++, VC++ 6.0, or VC++ 7.1?

##### Share on other sites
6.0 for sure, I don't know about the others.. never used them.

##### 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 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 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

HTH

##### Share on other sites
well gosh [oh], wish I had known that a few months ago.

1. 1
2. 2
3. 3
Rutin
22
4. 4
5. 5

• 13
• 19
• 14
• 9
• 9
• ### Forum Statistics

• Total Topics
632930
• Total Posts
3009289
• ### Who's Online (See full list)

There are no registered users currently online

×