刚学tc,编程问题
#include<graphics.h>
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
# include "math.h"
int t;
unsigned long s,a,b,x,o;
main()
{
srand(time(0));
a=rand();
b=20061214;
float num[7];<<<<<<<<<<<<无符号长整形数组怎么。。。》》》》》》
FILE *fp;
fp=fopen("string","rb");
for(t=0;t<=6;t=t+1)
fread(&num[t],sizeof(int),1,fp);
if (num[5]==null)
{
printf("Please input key:");
scanf("%lu",&b);
num[0]=a;
num[1]=b;
num[6]=302;
num[5]=a*b+a-b*234586;
printf("Your SN is: %lu.",&num[5]);
}
for(t=0;t<=6;t=t+1)
printf("num=%f \n",num[t]);
}
文件string有7个10位数字,
请各位指点
另外修改后怎么回写到文件