#include<stdio.h>
#include<stdlib.h>
typedef struct staff
{
int num;
char name[10];
}sta;
int main(void)
{
sta *sta1[3];
FILE* fp;
int i=0;
fopen_s(&fp, "D:\\xqx.txt", "r");
while(1)
{
if (sta1[i]!=NULL)
{
fscanf_s(fp, "%d%s", sta1[i]->num, sta1[i]->name);
i++;
}
continue;
}
printf("%10d%5s", sta1[i]->num, sta1[i]->name[10]);
fclose(fp);
return 0;
}
顺便想向你们问一下,如果c语言想要进阶有什么书可以推荐的,以及如何进阶。谢谢各位啦!