上一页 1 2 3 4 5 6 7 8 9 ··· 19 下一页
摘要: #include<stdio.h> //指针数组, 数组里面的每一个元素都是指针 int main() { int a = 10; int b = 20; int c = 30; // int* p1 = &a int* p2 = &b int* p3 = &c int* number[3] ={& 阅读全文
posted @ 2022-11-01 22:14 朵朵奇fa 阅读(87) 评论(0) 推荐(0)
摘要: 这样的语法是错误的: void a = 10; void表示无类型, 这样定义一个变量a, 编译器是无法知道给a分配多大的内存空间的 #include<stdio.h> #include<stdlib.h> // 1. void 限定函数的返回值, void 函数没有返回值 void functio 阅读全文
posted @ 2022-10-30 12:54 朵朵奇fa 阅读(342) 评论(0) 推荐(0)
摘要: 当打开一个文件时, 系统会返回一个结构体, 这个结构体有对此文件操作的所有信息 调用fopen时,系统返回这个结构体的地址 FILE *p = fopen("a.txt") 打开一个文件 FILE *fp = fopen(path,打开方式) #include<stdio.h> #include<s 阅读全文
posted @ 2022-10-30 12:12 朵朵奇fa 阅读(126) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> #define FIRST 1 #define SECONED 2 #define THIRD 3 int main (void) { printf("%d, %d , %d\n",FIRST , SECONED, THIRD 阅读全文
posted @ 2022-10-30 11:57 朵朵奇fa 阅读(65) 评论(0) 推荐(0)
摘要: typedef是用来给类型去别名的 用法: typedef 原类型 新类型 #include<stdio.h> #include<stdlib.h> //typedef变量取别名 int main (void) { int a = 10; typedef int u32; //typedef 原类型 阅读全文
posted @ 2022-10-30 09:53 朵朵奇fa 阅读(190) 评论(0) 推荐(0)
摘要: 共用体: 多个变量(不同的数据类型)共用同一块内存空间, 但是同一时刻, 只能有一个变量起作用 共用体中起作用的的成员是最后一次存放的成员 #include<stdio.h>#include<stdlib.h> //define union union myUnion{ char a; short 阅读全文
posted @ 2022-10-29 22:54 朵朵奇fa 阅读(220) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> struct stu { int id; int age; char name[128]; }; /* struct heima_stu { int id; int age; char names[128]; int chin 阅读全文
posted @ 2022-10-29 22:19 朵朵奇fa 阅读(75) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> struct stu { int id; int age; char name[128]; }; int main (void) { //结构体数组: 数组中的每一个元素都是结构体 struct stu num[5] = {{ 阅读全文
posted @ 2022-10-29 22:06 朵朵奇fa 阅读(169) 评论(0) 推荐(0)
摘要: 只有当定义了结构体变量的时候才会分配内存空间, 比喻说 struc stu { int id; int age; char name[28]; } struct stu d; 这个时候才会分配内存空间 (1) 定义结构体类型, 以及初始化结构体变量 #include<stdio.h> //关键字 s 阅读全文
posted @ 2022-10-29 18:12 朵朵奇fa 阅读(148) 评论(0) 推荐(0)
摘要: 数组名:【数组名是地址常量】-- 不可以被修改 #include<stdio.h> int main (void) { int a[3] = {1,2,3};//a是数组名, 数组名是地址常量,不能被修改 int b[3] ; printf("the a is %x", a); b = a ;// 阅读全文
posted @ 2022-10-24 21:51 朵朵奇fa 阅读(120) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 19 下一页