无法从const char转换为char

时间:2014-10-23 22:04:36

标签: c++ arrays const

每次我尝试运行此代码时,它都会告诉我,我无法将const char转换为char。我只想将多维数组定义为不同的单词。

#include "stdafx.h"
#include <iostream>
using namespace std;


int main(){

    char x[3][50];

    x[0] = "hello"; 
    x[1] = "BYE"; 

    cout << x[0] << endl; 
    cout << x[1] << endl; 
    system("pause"); 
    return 0;
}

0 个答案:

没有答案