小编mr.*_*tr0的帖子

不存在从“std::string”到“const char *”的合适的转换函数 c++

这是一个用于版本号目录的简单程序。它无法编译,出现此错误:

不存在从“std::string”到“const char *”的合适转换函数

#include <iostream>
#include <stdio.h>
#include <io.h>

using namespace std;

int main() {
    int max = 10, daily_patch = 0, monthly_patch = 0, yearly_patch;

    cout << " Enter the yearly_patch Number : ";
    cin >> yearly_patch;

    for (int i = yearly_patch; i <= yearly_patch; i++) {
        for (int j = 0; j < max; j++) {
            for (int k = 0; k < max; k++) {
                string str1 = to_string(i);
                string str2 = to_string(j);
                string str3 = …
Run Code Online (Sandbox Code Playgroud)

c++

-1
推荐指数
1
解决办法
129
查看次数

标签 统计

c++ ×1