Developing a C language program in Visual Studio

Source: Internet
Author: User

→ 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.