atnatn
atnatn

Reputation: 238

What is .NET and how do I know if my project uses it?

I have a C++ assignment and it specifies that I may not use .NET technology in my project. What is .NET and how do I know if my Visual C++ project uses .NET or not?

I am using Visual Studio 2008.

Upvotes: 0

Views: 1132

Answers (4)

Andrei Bozantan
Andrei Bozantan

Reputation: 3941

If your project is using .NET, the auto-generated main function looks like this:

int main(array<System::String ^> ^args)

If your project doesn't use .NET, the auto-generated the main function usually looks like this:

int _tmain(int argc, _TCHAR* argv[])

For more information about .NET, you can just check the Wikipedia article .NET Framework.

Upvotes: 2

Mike S
Mike S

Reputation: 551

.NET is a Microsoft development framework. Its Common Language Runtime (CLR) is the basis for languages like C#, and it includes a lot of prewritten code libraries for simplifying common tasks.

Long story short, if you're coding in C++, you aren't going to be using any .NET functionality unless you accidentally set up a managed/CLR project, or you're specifically trying to use it.

Therefore, as others said, make sure you create the right kind of project. For a school assignment, you will probably want to create something like a Win32 Console Application. Just make sure that you don't create a CLR project (managed project).

To doublecheck, do this: When your project is open, right click on your project name on the left (in Solution Explorer) and go to properties. Under Configuration Properties->General, you will see the "Common Language Runtime Support" feature at the bottom. Make sure it says "No Common Language Runtime Support," which will ensure the /clr compiler flag is not set.

I just checked that in Visual Studio 2010, so it might be very slightly different in 2008 (they rearranged some of the project menus around a bit), but I'm sure you get the idea.

Upvotes: 4

ʞᴉɯ
ʞᴉɯ

Reputation: 5594

If you want to use C++ without .NET you need to make a "UNMANAGED" C++ project.

Upvotes: 2

ty812
ty812

Reputation: 3323

If you are using vanilla Visual Studio 2008, you are using .NET - it's as easy as this. You can still make the project "UNMANAGED" to get a "pure" C++ project.

The .NET Framework is a software framework that runs primarily on Microsoft Windows and is pushed my Microsoft. It allows language interoperability (each language can use code written in other languages), but your prof is most likely not too thrilled that you might just use the rather extensive libraries.

Upvotes: -2

Related Questions