- 博客(6)
- 收藏
- 关注
原创 学习笔记
高级指针 指针即内存地址 内存地址: 4G虛拟内存 编号0-4G 0x0000 0000 - 0xffffffff 指针变量: 保存内存地址的变量 *内存地址 取值 &变量 取址 定义指针变量: 类型 *p; 类型:p存储的地址上存储的数据类型 int *p; int* 是指针的类型 int是指p存储的地址,那片地址上的数据类型 指针算术运算: p+1; p++; 指针+1,加了单位长度的内存地址 NULL 悬空指针 野指
2020-07-26 19:55:29
99
原创 学生管理系统
#include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct Stu{ int no; char name[40]; int score[3]; }Stu; int makeno=20200001; Stu pstu=NULL; size_t capcity=10; size_t size=0; #define N 3 #define STUSIZE sizeof(Stu) int adds
2020-07-26 19:23:16
163
原创 推箱子小游戏
#include <stdio.h> #include<stdbool.h> #include “get_keyboard.h” //座位 排 每一排 多少列 7行8列 两个维度 行和列 编号索引 行[0-6] 列[0-7] //0 路 //1 墙 //2 箱子 //3 终点 //4 小老鼠 //5 小老鼠站在终止上 //6 箱子到达终点上 //7 int g_boards[7][8] = { {0,1,1,1,1,1,1,0}, {0,1,0,0,0,0,1,1},
2020-07-19 11:40:42
277
原创 strlen,strcpy,strncpy,strcat,strncat等函数原型代码
** strlen,strcpy,strncpy,strcat,strncat等函数原型代码 **#include<stdio.h> #include<assert.h> size_t mystrlen(const char s){ assert(s!=NULL); size_t len=0; for(len=0;(s+len)!=’\0’;len++); return 0; } char *mystrcpy(char *dest,const char *src){ ass...
2020-07-19 11:34:21
147
2
原创 c语言猜数字游戏
游戏规则 猜数字 随机生成一个数字 n 在(0,100)区间 假设23 设置:0 退出游戏 提示用户: 请猜一个数字在(0,100)区间: 50 你猜的数字太大了 请猜一个数字在(0,50)区间: 17 你猜的数字太小了 请猜一个数字在(17,50)区间: 87 别闹,你猜的数字不在区间范围 请猜一个数字在(17,50)区间: … 23 恭喜中奖了! 代码 #include <stdio.h> int main(){ int res=0,big=100,small=0; srand(tim
2020-07-12 09:53:57
448
原创 c语言猜拳游戏
swich语句写一个简单的猜拳游戏 跟电脑玩 石头剪刀布 输入用户出 哪个 电脑随机出 判断谁赢谁输 平局 #include <time.h> srand(time(NULL)); int opt = rand()%3;//生成随机数 代码 #include<stdio.h> #include <time.h> int main(){ int input; srand(time(NULL)); int opt=rand()%3;//0代表剪刀,1代表石头,2代表布 sca
2020-07-12 09:39:56
1409
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人