{:5_90:}
0只认识机器语言
1c语言
2编程
3代码
1
第一次回帖,支持小甲鱼
0行代码。。。
额。。
666666666666666666
加油
我是哪里打错了吗?
0行代码?
1
windows下的vc6.0在编写完代码统计这个程序后,如何统计其他的程序代码行数
看答案啊亲
老师,我写的这个没有错误但是结果不对啊 求解
#include <io.h>
#include <direct.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 256
long total;
int countLines(const char *filename);
void findAllCodes(const char *path);
void findALLFiles(const char *path);
int countLines(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)) != EOF)
{
if (temp == '\n')
{
count++;
}
}
fclose(fp);
return count;
}
void findAllCodes(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(target);
}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, "the path %s is wrong!\n",path);
return;
}
do
{
if (!strcmp(fa.name, ".") || !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("ji suan zhong...\n");
findAllCodes(path);
findALLDirs(path);
printf("mu qian ni zong gong xie le %ld hang dai ma !\n\n",total);
system("pause");
return 0;
}
1
看答案
看一下答案
第十行这个错误是什么
1
anan
打完了,在函数‘findAllDirs’中:
count_linse.c:(.text+0x210):对‘cloesdir’未定义的引用
collect2: 错误:ld 返回 1
看不懂