预启动任务“C/C++:gcc.exe 构建活动文件”终止,退出代码为 -1 错误

问题描述 投票:0回答:0

当我尝试在 Visual Studio Code 中运行此

C
代码时:

#include <stdio.h>

int main() {

    int num, i = 0, lowest;

    int array[10];

    while(i != 10) 
    {
        printf("Please write %d. integer.\n\n", i);
        if(scanf("%d", &num) == 1) {
            i = i + 1;
             // Clear the input buffer
            while (getchar() != '\n');
            continue; // Restart the loop
            
            if(i == 1) {
                lowest = num;
            } else if(lowest > num || lowest == num) {
                lowest = num;
            }
        }
       
    }
    
    printf("Lowest number in array is %d. ", lowest);

    return 0;
}

它说: preLaunchTask 'C/C++:gcc.exe build active file' 终止并退出代码 -1

我选择了“无论如何调试”。而且这个也不能解决我的问题。

我希望我的程序能够工作,但由于某些原因它没有工作。 我以为是关于

mingw
但我已经安装了。

c gcc exit-code
© www.soinside.com 2019 - 2024. All rights reserved.