18381558755 发表于 2016-3-4 18:56:27

请大神看看那出错了

因为不在电脑旁,用手机写的
#include<io.h>
#include<direct.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#defing MAX 256
long total;
int countLines(const char *filename);
void findAllCodes(const char *path);
void findALLFiles(const char *path);
int counfLines(const char *filename) {
FILE *fp;
int count = 0;
int temp;
if ((fp = fopen(filename, "r")) == NULL) {
    fprintf(stderr, "can not open the file:%s\n", filename);
    return 0;
}
while ((temp = fgetc(fp)) i = EOF) {
    if (temp == '\n') {
      count ++;
    }
}
fclose(fp);
return count;
}
void find ALLCodes(const char *path) {
struct _finddata _t fa;
long handle;
char thePath, target;
strcpy(thePath, path);
if ((handle = _findfirst(strcat(thepath, "/*.c"), &fa)) != -1L) {
    do {
      sprintf(target, "%s / %s", path, fa.name);
      total + = countLines(tatget);
    } while (_findnext(handle, &fa) == 0);
}
_findclose(handle);
}
void findALLDirs(const char *path) {
struct _finddata _t fa;
long handle;
char thePath;
strcpy(thePath, path);
if ((handle = _findfirst(strcat(thepath, "/*"), &fa)) == -1L) {
    fprintf(stderr, "thepath %s is wrong!\n", path);
    return;
}
do {
    if (!strcmp(fa.name, ".") ll ! strcmp(fa.name, ".."))
      continue;
    if (fa.attrib = _A _SUBDIR) {
      sprintf(thepath, "%s / %s", path, fa.name);
      findAllcodes(thepath);
      findALLDirs(thepath);
    }
} while (_findnext(handle, &fa) == 0);
_findclose(handle);
}
int main() {
char path = ".";
printf("计算中...\n");
findAllcodes(path);
findALLDirs(path);
printf("目前你总共写了% ld 行代码!\n\n", tatol);
system("pause");
return 0;
}
求大神们看看哪出错了c4提示是/data/data/com.n0n3m4.droidc/files/temp.c:1:15: fatal error: io.h: No such file or directory
compilation terminated.

小甲鱼 发表于 2016-3-4 20:28:52

厉害,用手机码这么多……

打不开此文件“/data/data/com.n0n3m4.droidc/files/temp.c”

满满 发表于 2016-3-4 20:45:40

应该是缺少头文件 io.h
页: [1]
查看完整版本: 请大神看看那出错了