c
liuhongyi0104
step is all
展开
-
c语言fwrite和fread连续读写文件流
c语言fwrite和fread连续读写文件流本例程的编写是基于windows,编译器用的是gnu下的gcc:头文件stdio.h和stdlib.h读写函数是fwrite和fread文件指针移动函数有lseek,ftell,fseek*文件结束判断函数feof函数的具体参数和返回值可查阅手册连续写入long类型的一个数组#include <stdio.h>#include <stdli原创 2017-01-24 17:29:20 · 25214 阅读 · 0 评论 -
c语言函数参数传地址时容易发生的错误
首先看两个函数函数1:void assign1(int *x){ int a=100; x=&a;}函数2:void assign2(int * x){ int a=100; *x=a;}然后 我们写个demo测试一下两个函数 demo1:#include <stdio.h>int main(int argc, char const *argv[]){ int原创 2017-04-26 00:49:25 · 1093 阅读 · 0 评论 -
while循环的特殊写法
很有趣的东西, while –>写法:#include "hello.h"int main(int argc, char const *argv[]){ int a=10; while(a-->5) printf("%d\n",a); while(--a>1) printf("%d\n",a); return 0;}js也支持这样写:var a=10while(原创 2017-04-26 01:08:31 · 2445 阅读 · 0 评论