2015-08-11 c语言--一个很搓的malloc的实现 malloc的用法在堆中申请一块空间,并返回空间的首地址The malloc() function allocates size bytes andreturns a pointer to the allocated memory. malloc原型void *malloc(size_t size); c语言基础 malloc more >>
2015-08-04 c语言--位操作实现ftoi ftoi将浮点数转换成浮点数 浮点数的存储方式0 : 符号位1-8 : 指数位9-31 : 尾数位可以写个函数来输出浮点数的存储情况 c语言基础 位运算 more >>
2015-08-03 c语言--素数的查找 查找素数普通版123456789101112131415void prime_num(int n){ int i = 0; int j = 0; for(i = 2; i < n; ++i){ for(j = 2; j <= i; ++j){ if(i % j == 0){ break; } } if(j > i / 2){ printf("%d ", i); } }} c语言基础 more >>
2015-08-03 c语言--两个整数的交换函数 写一个函数用来交换两个整型变量的值声明void swap(int a, int b); 方式1123456void swap(int *a, int *b){ int temp = *a; *a = *b; *b = temp;} c语言基础 more >>
2015-08-03 c语言--strcpy函数实现 strcpy函数原型声明char * strcpy(char dest, const char *src); 头文件string.h 功能把src地址开始且含有NULL结束符的字符串复制到dest开始的地址空间 返回值返回复制后的字符串的首地址 c语言基础 函数原型 more >>
2015-07-27 linux学习--磁盘分区和lvm的使用 磁盘分区对linux的第二块磁盘进行分区使用fdisk /dev/sdb12345678[root@localhost ~]# fdisk /dev/sdbWelcome to fdisk (util-linux 2.23.2).Changes will remain in memory only, until you decide to write them.Be careful before using the write command.Command (m for help): linux基础 linux基础 more >>
2015-07-27 linux学习--yum使用yum源配置 yum源配置yum支持三种,htttp,ftp,和本地文件1 找到与本机相匹配的镜像源2 编辑yum配置 配置本地源以配置本地源为例 linux基础 linux基础 more >>
2015-07-27 linux学习--文件打包压缩 文件压缩compresscomprss是一个比较老的压缩命令1 压缩compress file 生成 file.z2 解压缩uncompress file.z linux基础 linux基础 more >>
2015-07-26 linux学习--网络设置 静态ip设置查看本机的局域网ipifconfig一般是在列出的第一项,一般为192.168.*.*如下所示,只列出了第一项,本机的ip为192.168.3.109 linux基础 linux基础 more >>