秀树君 发表于 2020-2-10 18:39:06

小甲鱼老乌龟

阿洲啊 发表于 2020-2-10 18:48:10

1072668539 发表于 2020-2-10 21:03:39

asdas

醉卧吟 发表于 2020-2-10 21:08:33

终于写完了...

laolefei 发表于 2020-2-10 21:15:03

真的很棒,感谢分享

单琪琪 发表于 2020-2-10 21:45:29

Good

最烦想名字 发表于 2020-2-10 22:20:06

..

学C从入门到入土 发表于 2020-2-10 22:29:38

{:5_91:}

aa55126132 发表于 2020-2-10 22:41:55

244

小源同学呀 发表于 2020-2-10 23:12:04

111

普朗克头号粉丝 发表于 2020-2-10 23:26:25

1

上课不学习 发表于 2020-2-11 00:19:37

111

178023076b 发表于 2020-2-11 01:09:09

太难了

拖延症大叔 发表于 2020-2-11 01:33:33

本帖最后由 拖延症大叔 于 2020-2-12 16:40 编辑

哎上来大多数没成功都是单词输错了    这是个心细的活啊{:10_250:}


为啥我的数不对啊{:10_266:}

复制了下原来的也是结果202为什么啊{:10_258:}

BetterCallSaul 发表于 2020-2-11 09:32:37

test01.c: In function ‘findAllDirs’:
test01.c:65: error: ‘entry_’ undeclared (first use in this function)
test01.c:65: error: (Each undeclared identifier is reported only once
test01.c:65: error: for each function it appears in.)
test01.c:65: error: ‘d_name’ undeclared (first use in this function)
test01.c:81:8: warning: multi-character character constant
test01.c:81: warning: passing argument 1 of ‘chdir’ makes pointer from integer without a cast
/usr/include/unistd.h:494: note: expected ‘const char *’ but argument is of type ‘int’





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);

ZoangX 发表于 2020-2-11 09:48:49

123

ctard 发表于 2020-2-11 09:57:27

....

康康学C 发表于 2020-2-11 10:20:22

..+

waylk17 发表于 2020-2-11 10:48:54

{:5_90:}

皮皮虾_8 发表于 2020-2-11 11:13:20

0行
页: 549 550 551 552 553 554 555 556 557 558 [559] 560 561 562 563 564 565 566 567 568
查看完整版本: S1E2:第一个程序 | 课后测试题及答案