其他分享
首页 > 其他分享> > 0:打开C语言大门

0:打开C语言大门

作者:互联网

C语言教程

C语言教程开端

1—0 : 第一个程序讲解

// # include 包含 <stdio.h> .h head 有文件 stdio

// standard i input 输入 o out 输出

// 这个文件可能会包含一个标准输入输出的头文件
#include<stdio.h>

int main(void) 
{


    /* 注释:不被编译器识别 */
    // 注释
    printf("Hello World! \n");

    // print 打印 f format 格式化

    // printf 格式化输出

    return 0;
}
输出结果 :Hello World!
解析:

缺少 #include<stdio.h> 会报错:

报错展示:

demo.c: In function ‘main’:
demo.c:14:5: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]   
     printf("Hello World! \n");
     ^~~~~~
demo.c:14:5: warning: incompatible implicit declaration of built-in function ‘printf’
demo.c:14:5: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’

以上笔记内容来源于B站: Micro_Frank

标签:main,include,头文件,语言,declaration,C语言,printf,打开,大门
来源: https://www.cnblogs.com/NorthFot/p/c.html