English 中文(简体)
我如何改变《科索沃法典》中使用的C++语言标准?
原标题:How can I change the version of the C++ language standard used in VS Code?

我印刷了<代码>+__cplus宏观价值,发现我的档案与C++98在视觉演播室法中执行。 I m 采用《刑法》延长。

我如何把这改为C++17?

问题回答

转口,然后打探条码ms-vscode.cpptools

在<代码>C/C++的延伸和的展期上,应安装一个装置icon。 Click it。

应开张。 选择<代码>Extension Settings

现在,在搜索栏中点击(有时,在你能够打上两次点击,而不必更换推广过滤器)和“密码”栏。

从这里看,你们应看到两种选择:一种是使用标准,另一种是标准。

Change Cpp Standard to your desired version. I generally use c++20.

“entergraph

此外,确保你的夸张使用同一版本。 任务: 该版本的定义。

{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: g++.exe build active file",
            "command": "C:\msys64\mingw64\bin\g++.exe",
            "args": [
                "--std",
                "c++20",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "Task generated by Debugger."
        }
    ],
    "version": "2.0.0"
}

如果你使用密码操作器,则采取下列步骤:

  1. Go to Settings ->extensions -> 滚动代码配置 或你只能把《守则》的仪表扫描在延伸表上,并选择<代码>扩展字条/代码>。

  2. 前往《守则》执行者:执行者地图环境然后点击<代码>。 Edit in context.json

  3. 你可以看到一条与违约的“<代码>”cpp”相一致的行文:“d$dir && g++$fileName -o$fileNameWithout Ext &&$dir$fileNameWithoutExt"

  4. 将“代码”改为“编码”;“d$dir && g++$fileName -std c++23 -fdiagnostics-color=always -o$fileNameWithout Ext &&$dir$fileNameWithoutExt"

  5. The version that you will be using is specified in the after the flag --std, for example c++23

  6. 采用《鲁纳法典》





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签