C/C++の宿題をやらせて、お兄ちゃん 22代目
レス数が900を超えています。1000を超えると表示できなくなるよ。
0902デフォルトの名無しさん
NGNG#include <stdio.h>
int main(int argc, char *argv[])
{
char s[2], buf[20];
char *ret;
FILE *fp;
if (argc > 1) {
fp = fopen(argv[1], "r");
if (fp == NULL) {
strcpy(buf, "ERROR: ");
strcat(buf, argv[1]);
puts(buf);
exit(1); }
ret = fgets(s, 2, fp);
if (ret != NULL) {
printf("A top character code is %d. \n", s[0]); }
else {
printf("It is an empty file. \n"); }
fclose(fp); }
else {
printf("Processing was not performed. \n"); }
return 0;
}
レス数が900を超えています。1000を超えると表示できなくなるよ。