吃鱼的王八 发表于 2023-5-6 00:20:13

闲闲的又一天 发表于 2023-4-19 13:35
我的运行出错,有高手能帮忙看下什么原因吗?初学者没找到问题。谢谢
输出日志如下:
cd "c:%u ...

这个问题解决了吗,我也遇到了

吃鱼的王八 发表于 2023-5-6 00:23:58

闲闲的又一天 发表于 2023-4-19 13:35
我的运行出错,有高手能帮忙看下什么原因吗?初学者没找到问题。谢谢
输出日志如下:
cd "c:%u ...

保存再运行就好了

爱吃梨的猩猩 发表于 2023-5-19 19:38:19

非常不错的好方案

鸡你实在太没 发表于 2023-5-19 19:40:32

教程好详细,值得学习

zhuyanan 发表于 2023-5-19 19:43:45

非常好正准备用VS就出教程了

lonely_xiaoying 发表于 2023-5-19 19:52:59

太方便啦 网上资料很多 但是一般都实现不了

shane9611 发表于 2023-5-19 19:57:32

对新手小白来说环境搭建非常重要,太贴心了,赞

clollipops 发表于 2023-5-19 20:46:42

本帖最后由 clollipops 于 2023-7-25 18:32 编辑

VSCode搭建C语言学习环境超详细教程

Tiamsy 发表于 2023-5-19 21:19:11

成功学习{:5_95:}

凌凌祺 发表于 2023-5-20 09:40:20

超详细

C1em 发表于 2023-5-20 11:30:05

学习使我快乐

Eric_1891574 发表于 2023-5-20 11:57:52

学习了

xyt210819 发表于 2023-5-20 17:05:37

c语言感觉比python难好多呀!个人理解 好好学习python,大家加油

铭凡 发表于 2023-6-5 21:14:53

本帖最后由 铭凡 于 2023-6-5 21:18 编辑

兄弟们,我的电脑环境有些乱。看小甲鱼“零基础入门学习C语言”教程的时候装了VC++6.0,然后后来嫌麻烦安装了DEV编译器,后来下的VS2022,然后又是VScode(跟小甲鱼老师配置的不一样,这个时候我变成完了总是要用cmd打开当前路径,之后用gcc FileName.c -o OutputName的格式用)但是今天调试的时候就出问题了emm,求教,感谢大家了!

报错如下:会弹出一个窗口显示以下内容

Visual Studio Code


launch: program 'D:\Desktop\Others\Programming\C Language\Self\图书管理系统\第十六周课设\CPP\main.exe' does not exist

[打开“launch.json”] [取消]

葡萄仔 发表于 2023-6-15 23:07:07

为什么我按步骤配置完以后输入第一个代码可以输出,第二个代码就没有输出了呢,然后重新试了一下第一个代码,也没有输出了

闲闲的又一天 发表于 2023-6-19 08:34:47

闲闲的又一天 发表于 2023-4-19 13:35
我的运行出错,有高手能帮忙看下什么原因吗?初学者没找到问题。谢谢
输出日志如下:
cd "c:%u ...

谢谢

六翻了 发表于 2023-7-4 20:35:55


#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("计算中...\n");
      
      findAllCodes(path);
      findALLDirs(path);
      
      printf("目前你总共写了 %ld 行代码!\n\n", total);
      system("pause");
      
      return 0;
}
C语言第一节课课后作业代码,第二个printf没有输出,也没有任何报错

caoliu023 发表于 2023-7-12 20:22:49


我想请教一下,(找到 “code-runner.executorMap”,然后找到 “c”,添加 “&& chcp 65001”:)我的配置还很空,我怎么修改

零寒 发表于 2023-7-18 04:38:07

问个问题
为什么exited with code=1 in 0.196 seconds
我这里code=1
小甲鱼那里是0
还有就是自己运行代码遇到的问题如果
显示“undefined reference to `WinMain'”
可以试试先检查一下有没有敲错代码,然后CTRL+s保存以后在运行{:10_257:}

chengzhi_ 发表于 2023-7-18 19:28:04

这个教程真的有用
页: 1 [2] 3
查看完整版本: VSCode搭建C语言学习环境超详细教程