calloc、realloc 基本用法

#include "stdio.h"#include "malloc.h" int main(void){ void i_o(int); int n,m; printf("input the number of datas:"); scanf("%d",&n); printf("input the add number of datas:"); scanf("%d",&m); i_o(n,m); putchar('\n'); return 0;} void i_o(int n,int m){ int i,*p; p=(int *)callo...
默认分类 | 2009-12-27 15:44 | 阅读 793 次 | 评论 0 条

一道文件操作题

#include "stdio.h"#include "string.h"struct kczl/*结构体类型声明*/{ char kc_no[20]; char kc_name[50]; int kc_credithr; char kc_xingzhi[60]; int kc_zhongxueshi; /*应该是整型吧*/ int kc_shoukeshi; int kc_shangjixueshi; char kc_kxxueqi[40];}s[100]; void display(int i){ printf("\t\t...
默认分类 | 2009-12-21 20:35 | 阅读 1091 次 | 评论 5 条

三天打鱼两天晒网

#include "stdio.h"#include "conio.h" int fun2(int year,int month,int day){ int daynow,daysum,month2,monthdays=0; if((year%4==0&&year%100!=0)||(year%400)==0) month2=29; else month2=28; switch(month) { case 1: daynow=31; daysum=0; break; case 2: daysum=31; break; case 3...
默认分类 | 2009-12-21 15:20 | 阅读 1517 次 | 评论 2 条
文章分类