Skip to content

Instantly share code, notes, and snippets.

@mattn
Created January 23, 2018 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/3b914a3429e426ee71012df9f4324442 to your computer and use it in GitHub Desktop.
Save mattn/3b914a3429e426ee71012df9f4324442 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
void meibo(int *a, char *filename){
FILE *fp;
char keep[100];
int i, count;
char *b;
if((fp=fopen(filename,"r"))==NULL){
printf("File%s doesnt exist \n",filename);
exit(1);
}
if(fgets(keep,10,fp) == NULL){
puts("Could not get count of records");
exit(1);
}
count = atoi(keep);
for(i = 0; i < count; i++){
fgets(keep,100,fp);
/* ここで1行(keep)を分割して構造体に格納していく処理を書く */
}
/* make_student(keep); */
fclose(fp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment