⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 init_examination.c

📁 比较原始的学校出题系统
💻 C
字号:
#include<stdio.h>
struct examination
{
int acctNum;
int type;
int knowledge;
char content[100];
char answer[10];
};
main()
{
int i;
struct examination blankexam = {0,0,0,"",""};
FILE * cfPtr;
if((cfPtr = fopen("data.dat","w")) == NULL)
{
printf("File could not be opened.");
getch(); 
}
else 
{
for(i=1;i<=100;i++)
fwrite(&blankexam,sizeof(struct examination),1,cfPtr);
fclose(cfPtr);
printf("opened file");
getch();
}
return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -