[关闭]
@pnck 2023-08-21T01:11:14.000000Z 字数 11029 阅读 4046

Getting familiar with C

本文档由 Markdown「语言」强力驱动


No.0x00.    为什么要学C语言 & 什么样的我最应该学C语言?


No.0x01.    我应该用什么工具来学习?


No.0x02.    关于C语言标准我有很多疑惑,为什么书上的和我的工程不一样,为什么书上的代码编译不通过

1. void main()与int main(),还有main()有什么不同?main函数括号里的东西是什么?为什么有时候有有时候没?

2. 各编译器都支持什么标准?相互有什么区别?


No.0x03.    所谓的代码风格是什么,为什么需要良好的代码风格?

1. 代码为什么不是越短越简单越好?

2. 怎样才叫良好的代码风格?

No.0x04.    I know a little about C++...

You know little about c++.

1. 「C++是C的超集」到底是什么意思?

2. 「我已经学到C++了,不用再回过头学C了」?

3. 似乎总有谜语人在说我看不懂的C++的梗


No.0x05.    更新说明和后记

(2021-8-31)

(2023-8-21)


引用和脚注

来自2014年的推荐——

Using Microsoft Visual Studio for Simple C Programs

  • To edit your C program:

    From the main menu select File -> New -> Project
    In the New Project window:
    Under Project types, select Win32 - Win32 Console Application
    Name your project, and specify a location for your project directory
    Click 'OK', then 'next'
    In the Application Wizard:
    Select Console application
    Select Empty project
    Deselect Precompiled header
    Once the project has been created, in the window on the left hand side you should see three folders:
    Header Files
    Resource Files
    Source Files
    Right-click on Source Files and Select Add-> New Item
    Select Code, and give the file a name
    The default here will be a file with a *.cpp extension (for a C++ file). After creating the file, save it as a *.c file.

  • To compile and run:

    Press the green play button.
    By default, you will be running in debug mode and it will run your code and bring up the command window.
    To prevent the command window from closing as soon as the program finishes execution, add the following line to the end of your main function:
    getchar();
    This library function waits for any input key, and will therefore keep your console window open until a key is pressed.



[1] 「抽象」这个词本身比较抽象,在计算机领域,它约等于「创造新概念」。拿「集合」这个大家都熟悉概念举例,有些语言中创造的「集合」能参与运算、能派生新概念(比如「是一种特殊集合」)、能限制内部数据满足数学上集合的定义、甚至还能定义在编译期。而C只能创造「定义集合操作相关的函数」,即所谓「抽象方式少」。
[2] 参见百度百科:C11与C99的对比
[3] main(n){gets(&n);putchar(n%85+5);}是不是很迷幻?看得懂不?
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注