ok
学习
谢谢
回复查看答案
0,只能识别0和1
1,机器语言
2编译
3,不能直接编译
4可以
5解释器
6查表
电脑只会0和1
机器语言
编译
?
不一定
?
主要靠编译表,一一对应就ok
朕想知道
壮大我c语言
对答案
jkj
1
因为它没有思想
666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666
I love FishC.com!
顶顶顶顶
计算机只认识0和1
机器语言二进制0和1
编译
编译型是将源代码编译为机器语言直接运行
解释型是先转化为中间语言再由解释器转化为机器语言
不可以
通过解释器
编码和解码
亲们趁敌人吃饭时发动进攻
:上课
:起立
:老师好,
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
:好的,同学们今天这节课就到这里
:起立
:小甲鱼老师辛苦了
本帖最后由 b_74 于 2019-9-3 14:52 编辑
#include <stdio.h>
#include <unistd.h>
#include <dirent.h>
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
#define MAX 256
long total;
int countLines(const char *filename);
int isCode(const char *filename);
void findAllDirs(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;
}
int isCode(const char *filename);
{
int length;
length = strlen(filename);
if (!strcmp(filename + (length - 2), ".c"))
{
return 1;
}
else
{
return 0;
}
}
void findAllDirs(const char *path)
{
DIR *dp;
struct dirent *entry;
struct stat statbuf;
if ((dp = opendir(path)) == NULL)
{
fprintf(stderr, "The path %s is wrong!\n",path);
return;
}
chdir(path);
while ((entry = readdir(dp)) != NULL)
{
lstat(entry->d_name, &statbuf);
if (!strcmp(".", entry->d_name) || !strcmp("..",entry->d_name))
continue;
if (S_ISDIR(statbuf.st_mode))
{
findAllDirs(entry->d_name);
}
else
{
if (isCode(entry->d_name));
{
total += countLines(entry->d_name);
}
}
}
chdir("..");
closedir(dp);
}
int main()
{
char path = ".";
printf("计算中...\n");
findAllDirs(path);
printf("目前你总共写了 %ld 行代码!\n\n",total);
return 0;
}
提示42行第1个字符错误
root@wang-virtual-machine:/home/myfiles# gcc s1e2.c -o s1e2.exe
s1e2.c:42:1: error: expected identifier or ‘(’ before ‘{’ token
{
^
请小甲鱼老师百忙之中不吝赐教,谢谢
环境是Ubuntu 18.04.02
Vim版本8.0
gcc版本7.4
嗯
看看看看