Why is the C “Hello World” project generated by Visual Studio looks a bit strange?

I am new to C programming (although I have experience in Java, C# and Visual Basic). I used Visual Studio 2010 to create a default “Hello World” sample project, but When I investigated the sample code it generated, it looked slightly different from the code I saw when I was viewing the C tutorial.

In my investigation, I learned that there are two types The version of C, or at least two different standards. I think they are called CLR and CLI. What standard or version do I have to learn to program further?

There are some common, regular C++ based on the ISO standard, which may be what you see in the tutorial The kind. If you want to write a Windows application in regular C, you may target the Win32 API (or use a set of classes that contain the basic functions of the Win32 API, such as MFC).

Then It is C++/CLI, it can almost be considered a brand new language (although it is a superset of C), which includes Microsoft extensions to support .NET Framework. It is standardized as ECMA-372 The .NET Framework runs on top of the CLR, so the C version compatible with the CLR is called “C/C++LI”.

You may want to completely ignore the C/C++LI changes of the language Body. It’s really only suitable for interoperability scenarios of .NET code. Since you seem to want to learn C, the additional CLI content can be confusing. You want to learn real C, not in C .NET Framework ported on top. If you want to learn .NET, please use C# or VB.NET first.

For more information about the difference between C and C/C++LI, please see my answer here.

I am new to C programming (although I have experience in Java, C# and Visual Basic). I used Visual Studio 2010 to create a default “Hello World” sample project, but when I investigate the sample code it generates, it looks slightly different from the code I saw when viewing the C tutorial.

In my investigation In, I learned that there are two versions of C, or at least two different standards. I think they are called CLR and CLI. What standard or version do I have to learn to program further?

There are some ordinary, regular C++ based on the ISO standard, which may be the kind you see in the tutorial. If you want to write Windows in regular C Application, it may be targeting the Win32 API (or use a set of classes that contain the basic functions of the Win32 API, such as MFC).

Then C++/CLI, It can almost be considered a brand new language (although it is a superset of C), which includes Microsoft extensions to support the .NET Framework. It is standardized as ECMA-372. The .NET Framework runs on top of the CLR, so it is compatible with The CLR-compatible version of C is called “C/C++LI”.

You may want to completely ignore the C/C++LI variant of the language. It actually only works for .NET code Interoperability scenarios. Since you seem to want to learn C, the additional CLI content will be confusing. You want to learn real C, not the .NET Framework ported on top of C. If you want to learn .NET, please use C# or VB.NET first.

For more information about the difference between C and C/C++LI, please see my answer here.

Leave a Comment

Your email address will not be published.