小编dou*_*uyu的帖子

VScode 远程连接错误:进程试图写入不存在的管道

我用vscode和remote-ssh连接我的服务器,配置后,我想连接我的主机,但失败了,对话框显示:“无法建立与XX的连接,进程试图写入一个不存在的管道。”

输出:

[16:45:20.916] Log Level: 3
[16:45:20.936] remote-ssh@0.49.0
[16:45:20.936] win32 x64
[16:45:20.944] SSH Resolver called for "ssh-remote+aliyun", attempt 1
[16:45:20.945] SSH Resolver called for host: aliyun
[16:45:20.945] Setting up SSH remote "aliyun"
[16:45:21.012] Using commit id "c47d83b293181d9be64f27ff093689e8e7aed054" and quality "stable" for server
[16:45:21.014] Install and start server if needed
[16:45:21.019] Checking ssh with "ssh -V"
[16:45:21.144] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[16:45:21.214] Running script with connection command: ssh -T -D 5023 aliyun bash
[16:45:21.221] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[16:45:21.504] > 
> …
Run Code Online (Sandbox Code Playgroud)

ssh ssh-keys visual-studio-code vscode-settings vscode-remote

57
推荐指数
5
解决办法
7万
查看次数

SIGABRT 和 SIGSEGV 有什么区别

我用下面的两段代码犯了核心转储错误:

//test.cpp
int main()
{
    int *p = new int;
    *p = 100;
    delete p;
    delete p;
    return 0;
}

//test2.cpp
int main()
{
    int *p = new int;
    *p = 100;
    delete p;
    *p = 111;
    std::cout<<*p<<std::endl;
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

Gdb 告诉我,第一段代码由于信号 SIGABRT 而被核心转储,而第二段代码由于信号 SIGSEGV 而被核心转储。

你能说出有什么区别吗?

c c++ linux coredump signals

7
推荐指数
1
解决办法
7435
查看次数

如何比较两个 int64 的和与 INT64_MAX?

我知道大于的数字INT64_MAX会环绕负数,那么当总和溢出时如何比较,即总和大于INT64_MAX

#include <iostream>

using namespace std;

int main() {
  int64_t a = INT64_MAX;
  int64_t b = 1;
  // cin >> a >> b;
  if (a + b <= INT64_MAX) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

c++ integer

3
推荐指数
1
解决办法
312
查看次数

如何理解 cpp 中的 ++ cast 表达式?

我对语法++ cast-expression的理解如下:

float p = 3.14;
++(int)p;
Run Code Online (Sandbox Code Playgroud)

但是当我用clang编译它时,它无法编译。那么如何理解++ cast-expression以及有什么用呢? (int)p是一个cast-expression为什么它不起作用?

cpp-标准草案

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf

c++

0
推荐指数
1
解决办法
113
查看次数

OCaml:运行“dune init exec”后出现沙丘构建错误

我是 OCaml 新手,我按照教程搭建了开发环境。然后我尝试使用沙丘和 OCaml 的helloworld示例,但遇到以下错误:

\n
$ dune init exe helloworld\nSuccess: initialized executable component named helloworld\n$ dune build\nError: I cannot find the root of the current workspace/project.\nIf you would like to create a new dune project, you can type:\n\n    dune init project NAME\n\nOtherwise, please make sure to run dune inside an existing project or\nworkspace. For more information about how dune identifies the root of the\ncurrent workspace/project, please refer to\nhttps://dune.readthedocs.io/en/stable/usage.html#finding-the-root\n
Run Code Online (Sandbox Code Playgroud)\n

目录结构:

\n
.\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 _build\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 log\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 …
Run Code Online (Sandbox Code Playgroud)

ocaml dune

0
推荐指数
1
解决办法
1820
查看次数