簡體   English   中英

我不能使用 c++ 格式 header

[英]I can't use c++ format header

嗨,我正在進行基本的 c++ 測試,答案是必需的,所以我寫了 #include 但發生錯誤錯誤消息是 header 不存在

#include <iostream>
#include <format>
#include <string>


using namespace std;
int main()
{

    string str = format("{}+{}+{}", 16, 14, 30);
    cout << str << endl;
    return 0;
}

<format>是 C++ 20 功能。 您應該檢查您的測試站點的 C++ 版本

截至目前,沒有編譯器支持<format> 這里

或者,您可以使用fmt

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM