摘要: int num = 12345; 将12345作为二进制数存储到num中 1. fprintf(fp,"%d",num); //把字符'1','2','3','4','5'的二进制编码写入文件中 2. fwrite(&num, sizeof (int), n, fp); 把值12345的二进制编码写 阅读全文
posted @ 2016-05-08 13:44 芬乐 阅读(742) 评论(0) 推荐(0) 编辑
摘要: 1.声明一个数组,声明是用常量表达式指定数组维数,然后可以勇敢数租明访问数租元素。 2.声明一个变长数租,声明是用变量表达式指定数组维数,然后用数组名来访问数组元素(C99特性) double item[n]; //如果n是一个变量,C99之前不允许这样做。 3.声明一个指针,调用malloc(), 阅读全文
posted @ 2016-05-08 10:43 芬乐 阅读(2486) 评论(0) 推荐(0) 编辑
摘要: 1. <string.h> strcpy(), strlen(), strcat() 2. <stdlib.h> malloc(), free(), exit() 阅读全文
posted @ 2016-05-08 10:19 芬乐 阅读(135) 评论(0) 推荐(0) 编辑
摘要: struct namect { char * fname; //使用指针,而非数组 char * lname; int letters; }; void getinfo(struct namect * pst){ char temp[8]; gets(temp); pst -> fname = (char *)mallco(strlen(te... 阅读全文
posted @ 2016-05-08 09:40 芬乐 阅读(257) 评论(0) 推荐(0) 编辑