-
-
Save takatakamanbou/fdd5b225bc156562d073d76887c9f41c to your computer and use it in GitHub Desktop.
2017年度応用プログラミング演習 ex06D
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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