
C语言
文章平均质量分 53
笨笨且云雀
人生在于一次又一次的尝试与探索
2696866228@qq.com
展开
-
C语言关键字const
const修饰的数据类型是指常类型,常类型的变量或对象的值是不能被更新的。目的编辑const 推出的初始目的,正是为了取代预编译指令,消除它的缺点,同时继承它的优点。主要作用编辑(1)可以定义const常量,具有不可变性。 例如:constintMax=100; Max++会产生错误; (2)便于进行类型检查,使编译器对处理内容有更多了解,消除了一些隐患。 例如: void f(const int i) { .........}编译器就会知道i是一个常量...转载 2022-02-27 21:55:50 · 601 阅读 · 0 评论 -
C语言知识点笔记及代码实现
#include<stdio.h>#include<stdbool.h>#include<malloc.h>#include<time.h>#include<string.h>/*int main() { int arry[1001] = { 0 }; for (int i = 2; i <= 1000; i++) { if (arry[i] == 0) { printf("%d\n", i); for (..原创 2022-02-17 20:01:14 · 771 阅读 · 0 评论