上一页 1 ··· 67 68 69 70 71 72 73 74 75 ··· 167 下一页
摘要: // // main.c // const关键字,节省内存空间,放在字符表里面, #include int main(int argc, const char * argv[]) { /* 1.const,指针类型的左边、数据类型和*号之间,指针的指向可以改变,指向的内存空间中的值不能改变。 2.const写在指针的右边(数据类型 * const),... 阅读全文
posted @ 2017-08-21 14:58 无天666 阅读(154) 评论(0) 推荐(0)
摘要: // // main.c // typedef #include /* typedef可以给一个已知的数据类型起别名。 typedef 原有的数据类型 别名; 注意: 1. typedef不仅能给系统原有的数据类型起别名, 也可以给一个自定义的数据类型起别名 2. 利用typedef给数据类型起别名, 并不会生成一个新的数据类型, 仅仅是给原有的类型起了一个别名而已 ... 阅读全文
posted @ 2017-08-21 14:37 无天666 阅读(241) 评论(0) 推荐(0)
摘要: // // main.c // 文件包含 #include // 函数可以重复声明, 但不能重复定义 void test(); void test(); void test(); void test(); #include "zs.h"// 把zs.h文件全部拷贝多来,int sum(int v1, int v2);声明之后就可以用了。 // 重复导入会导致重复声明不会报错,但是会... 阅读全文
posted @ 2017-08-21 13:44 无天666 阅读(242) 评论(0) 推荐(0)
摘要: // // main.c // 条件编译(宏定义是简单的替换,要给参数和结果都加括号) #include #define SCORE 90 #define DEBUG 1 // 0是调试阶段 1是发布阶段 //printf和打印log是很消耗性能的。 #if DEBUG == 0 // 调试阶段 #define NJLog(format, ...) printf(format,##... 阅读全文
posted @ 2017-08-21 11:25 无天666 阅读(202) 评论(0) 推荐(0)
摘要: // // main.c // 宏定义 #include void test(); /* 预处理指令:在我们的文件翻译成0和1之前做的操作我们称之为预处理指令,一般以#号开头的(#include),包括:1.宏定义,2.条件编译,3.文件包含 */ /* 1.宏定义(会在程序翻译成0和1之前,将所有宏名替换为宏的值)的格式 1.不带参数的宏定义:#define 宏名 ... 阅读全文
posted @ 2017-08-21 10:39 无天666 阅读(502) 评论(0) 推荐(0)
摘要: main.c zs.c zs.h main.c main.c zs.h zs.c 阅读全文
posted @ 2017-08-19 22:39 无天666 阅读(2409) 评论(0) 推荐(0)
摘要: // // main.c // 枚举基本概念 #include int main(int argc, const char * argv[]) { // int sex = 0; // 女 // int sex = 1; // 男 // 枚举就是专门用于表示几种固定类型的取值 // 枚举的本质就是基本数据类型, 就是整形 //... 阅读全文
posted @ 2017-08-18 19:41 无天666 阅读(205) 评论(0) 推荐(0)
摘要: // // main.c // 结构体基本概念 // #include int main(int argc, const char * argv[]) { /* 基本数据类型: int double float char 构造类型: 数组/ 结构体 数组: 是用于保存一组相同类型的数据 结构体: 是用于保存一组不同类型的数据 ... 阅读全文
posted @ 2017-08-18 19:17 无天666 阅读(280) 评论(0) 推荐(0)
摘要: // // main.c // 指向函数的指针 #include void test() { printf("哥被执行了\n"); } int getAge() { return 30; } void sum(int v1, int v2) { int res = v1 + v2; printf("res = %i\n", res); } int... 阅读全文
posted @ 2017-08-18 17:03 无天666 阅读(281) 评论(0) 推荐(0)
摘要: // // main.c // 指针和字符串 // // Created by xiaomage on 15/6/14. // Copyright (c) 2015年 xiaomage. All rights reserved. // #include int main(int argc, const char * argv[]) { // 保存字符串 char s... 阅读全文
posted @ 2017-08-18 16:06 无天666 阅读(224) 评论(0) 推荐(0)
上一页 1 ··· 67 68 69 70 71 72 73 74 75 ··· 167 下一页