- 博客(11)
- 收藏
- 关注
原创 进程间通信
今天我们学习了进程间痛讯的几种主要方式:##管道(pipe)和有名管道(FIFO)##信号(signal)##消息队列##共享内存(semaphore)##信号量(spcket)运用二值信号与共享内存的进程间通讯代码如下shm1.c:#include <sys/ipc.h>#include <stdio.h>#include <...
2019-01-16 21:27:59
115
原创 简单停车场实现
parking_lot.main.c:#include<stdio.h>#include<string.h>#include<stdlib.h>#include"parking_lot.h"int main(){ int ret; int n; int number; int data; int a; int b; park_t ...
2019-01-14 20:54:45
275
原创 用指针函数打印二维数组
#include<stdio.h>int main(){ int a[2][5] = {{31,32,33,34,35},{61,62,63,64,65}}; int (*p)[5]; int i,j; p = a; for(i = 0;i < 2;i++) { for(j = 0;j < 5;j++) { ...
2018-12-02 22:08:06
746
转载 二维数组的行列转换
#include<stdio.h>int main(){ int a[5][2]; int b[2][5]; int i,j; int num = 10; for(i = 0;i < 5;i++) { for(j = 0;j < 2;j++) { a[i][j] = j + num; ...
2018-12-02 22:03:07
953
原创 字符串的相关函数详解
#include <stdio.h>#include <string.h>int my_strlen( const char *str){ int count = 0; while(*str) { count++; str++; } return count;}char *my_strcpy(char *dst, ...
2018-12-02 21:57:57
192
原创 计算器简单程序
简单计算器程序#include <stdio.h>int main(){ float num1; float num2; float res; int i; int ret; while( 1 ) { printf("-------------calc---------------- \n"); prin...
2018-12-02 21:53:19
337
原创 习题
1、求100以内的素数,全部打印出来#include <stdio.h> int main(){ int i,j; int temp; for(i = 2;i <=100;i++) { int temp = 1; for(j = 2; j < i;j++) { if(i % j == 0) ...
2018-11-23 21:04:15
204
原创 linux c 学习 (二)
一丶格式: echo “\033[字背景颜色;字体颜色m字符串\033[0m”例如:echo “\033[41;36m something here \033[0m”其中41的位置代表底色, 36的位置是代表字的颜色。字背景颜色范围:40----4940:黑41:深红42:绿43:黄色44:蓝色45:紫色46:深绿47:白色字颜色:30-----------3930:黑...
2018-11-18 20:21:45
119
原创 LinuxC学习
一、数据类型:整型、浮点型、字符型;1、整型 整型通俗来说就是数学中的整数整型中有这样的几种类型short 所占的存储空间为2个字节int 所占的存储空间为4个字节long 所占的存储空间为8个字节2、浮点型 浮点型通俗点来说也就是数学中的带有小数点的类型。浮点数也包含几种不同精度的类型float 单精度浮点型 占4个字节...
2018-11-17 22:55:29
114
原创 Linux的学习(第二天)
1、vim终端编辑器工作模式:正常模式、插入模式、编辑模式正常模式:使用vim打开文件时的默认模式vim 打开文件,若文件不存在则新建esc:切换到正常模式shift + : 进入底行模式(编辑模式)yy 复制光标所在行p 粘贴nyy 复制光标开始的n行dd 删除光标所在行ndd 删除光标开始的n行u 撤销操作插入模式:就是可以编辑文件内容的模式i:在光标处插入、编辑...
2018-11-11 20:09:38
111
原创 Linux的学习(第一天)
今天我们学习了一些linux的一些基础指令:ls 查找当前目录内容-l 列出文件详细信息-a 列出当前目录下所有文件及目录(包括隐藏的)chmod 更改权限cd 切换工作目录mkdir 新建文件夹touch 新建文件cat 查看文件内容cp 拷贝mv 移动或重命名rm 删除文件rm -rf 删除文件夹find 在文件系统中搜索某文件...
2018-11-10 19:36:00
162
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人