→ Create a new project
→ Select "Other Languages", "Visual C + +", and select "Win32 Console Application" and name the console application.
→ Click "Next"
→ Click "Finish"
→ Write The following
#include "stdafx.h"
int _tmain (int argc, _tchar* argv[])
{
printf ("Hello c\n");
GetChar ();
return 0;
}
→ Click "Run"
You see the characters that are output in the console.
What if I want to see the output character information in the Output window?
→ Write The following
#include "stdafx.h"
< Windows.h >
int _tmain (int argc, _tchar* argv[])
{
printf ("Hello c\n");
GetChar ();
OutputDebugString (L "Hello c\n");
return 0;
}
→CTRL+W, O Open Output window
→ Run the program
In the Output window, you see the output character information.
In addition, the C language files written by the storage Visual Studio need to be stored in an encoded format of UTF-8 for cross-platform use.
→ File
→ Advanced Save Options
→ select "utf-8" format in the "Encoding" option
Developing a C language program in Visual Studio