Build a Visual Studio 2013 project in pure C

后端 未结 1 1384
南方客
南方客 2020-12-18 10:48

What is the best way to do this? The templates seem to allow only for C++ (which is basically compatible with C, but not the same.) What is the proper way to do this? (A

1条回答
  •  有刺的猬
    2020-12-18 11:35

    The solution is simple and easy

    1. You create a new win32 console project

    2. Remove the default .cpp file

    3. Add new .c file as you wish

    4. In Properties, under C/C++ --> All Options, find "Compile as", then select "Compile as C code"

    two muppets

    1. Simple sanity check. This code doesn't work with C++ since "new" is a reserved word for C++.

      int new = 10;

    0 讨论(0)
提交回复
热议问题