Skip to content

Instantly share code, notes, and snippets.

@takatakamanbou
Last active October 14, 2017 02:17
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 takatakamanbou/fdd5b225bc156562d073d76887c9f41c to your computer and use it in GitHub Desktop.
Save takatakamanbou/fdd5b225bc156562d073d76887c9f41c to your computer and use it in GitHub Desktop.
2017年度応用プログラミング演習 ex06D
#include <stdio.h>
#include <stdlib.h>
★★★ 関数 LSearch のプロトタイプ宣言 ★★★
#define FNAME "primedata.txt"
#define NDATA 100
int main(void)
{
int x[NDATA], n, k, rv;
FILE *fp;
fp = fopen(FNAME, "r");
if(fp == NULL){
fprintf(stderr, "ERROR: fopen failed\n");
exit(EXIT_FAILURE);
}
for(n = 0; n < NDATA; n++){
if(1 != fscanf(fp, "%d", &x[n])) break;
}
fclose(fp);
while(1){
★★★ 実習のページ参照 ★★★
}
return 0;
}
★★★ 関数 LSearch の定義 ★★★
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment