小甲鱼老师我用的是visual studio 2019 ,然后输入完Windows的这一串代码后提升我说要在几个函数中加上_s,加了以后又提升函数中调用的参数太少该怎么办{:10_266:}{:10_266:}
{:10_333:}
参与学习
oo
计算机只认识0和1
{:10_277:}
加油
起夜趁敌人吃饭时发动进攻
哈哈
0.计算机只认识2进制
1.c
2.编译
3.前者一次过程完成编译
后者需要2次过程
4.能
5.通过框架
6.与密码本对照实现翻译
Mr`羽殇 发表于 2020-8-4 22:03
查看
您好,我检查了很多次和所给的代码是一样的
只认识二进制
#include <io.h>
#include <dirct.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 conuntLines(const char *filename)
{
FILE *fp;
int count= 0;
int temp;
if((fp = fopen(filename,"r"))== NULL)
{
fprintf(stdeer, "Can not open the file; %s\n", filename);
return o;
}
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
{
sprinf(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(theaPath);
findALLDirs(thepath);
}
}while (_findnext(handle, &fa) == 0)
_findclose(handle);
}
int main()
{
char path =".";
printf("计算中...\n");
findAllCodes(path);
findALLDirs(path);
printf("目前你总共写了 %ld 行代码!\n\n", total);
system("pause");
return 0;
}
不知道为啥,他最后显示这样。我就算复制粘贴也是这样。不知道有没有大哥能帮我发现下问题
第一次作业也太硬核了吧
对对答案
w
学到了
0.只认识0与1
1.机器语言
2.翻译
3.解释型语言需要通过解释器
4.否
5.
6.读表
7.亲们,趁敌人吃饭时发起进攻
答案
0.它只懂得二进制的0和1
1.机器语言
2.编译
3.解释型语言不直接编译成机器语言,而是将源代码转换成中间代码,然后发送给解释器,由解释器逐句翻译给CPU来执行
4.能
5.解释型语言不直接编译成机器语言,而是将源代码转换成中间代码,然后发送给解释器,由解释器逐句翻译给CPU来执行
6.一张莫尔斯编码表