小编sen*_*ron的帖子

在调试控制台 VScode 中使用输入(stdin)

我尝试在 VS Code 中调试一些代码。一切正常,但是当我尝试在控制台中输入某些内容时,什么也没有发生。

我的代码:

#include <stdio.h>

#define SIZE 20

int main()
{
    char arr[SIZE];
    
    fgets(arr, SIZE, stdin);

    puts(arr);

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

正如您所看到的,我过去常常fgets()从控制台读取字符串,但是当调试到达函数时,一切都会停止,我无法输入任何内容。

在此输入图像描述

只是黑窗。

但是,当我使用 时gets(),就像这个例子一样:

#include <stdio.h>

#define SIZE 20

int main()
{
    char arr[SIZE];
    
    gets(arr);

    puts(arr);

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

一切正常。

在此输入图像描述

哪里有问题?也许调试控制台无法读取任何内容?我怎样才能使用输入任何内容fgets()

这是我的 launch.json:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": …
Run Code Online (Sandbox Code Playgroud)

c debugging stdin fgets visual-studio-code

12
推荐指数
1
解决办法
1万
查看次数

安装 nao-pon/flysystem-google-drive Laravel 时出现问题

我安装时遇到问题nao-pon/flysystem-google-drive

当我运行命令时,作曲家需要nao-pon/flysystem-google-drivenao-pon/flysystem-google-drive:~1.1

我收到这样的错误:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - Root composer.json requires nao-pon/flysystem-google-drive ^1.1 -> satisfiable by nao-pon/flysystem-google-drive[1.1.0, ..., 1.1.x-dev].
    - nao-pon/flysystem-google-drive[1.1.0, ..., 1.1.x-dev] 
require league/flysystem ~1.0 -> found league/flysystem[1.0.0-alpha1, ..., 1.x-dev] but it conflicts with your root composer.json require (^3.0).
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades, and removals for packages currently locked to 
specific versions.
You can also try re-running composer require with …
Run Code Online (Sandbox Code Playgroud)

php laravel composer-php google-drive-api flysystem-google-drive

6
推荐指数
1
解决办法
3419
查看次数