现在这个代码有什么问题!错误C2440:'=':无法从'std :: string []'转换为'std :: string']'
页眉:
#pragma once
#include <string>
using namespace std;
class Menu
{
public:
Menu(string []);
~Menu(void);
};
实现:
#include "Menu.h"
string _choices[];
Menu::Menu(string items[])
{
_choices = items;
}
Menu::~Menu(void)
{
}
编译器抱怨:
error C2440: '=' : cannot convert from 'std::string []' to 'std::string []'
There are no conversions to array types, although there are conversions to references or pointers to arrays
没有转换!那么关于什么?
请帮忙,只需要传递一个血腥的字符串数组并将其设置为Menu类_choices []属性。
谢谢
谢谢GMan,这当然是非常丰富和工作。 我也移动_choices成为会员。欢呼 – Bach 2010-06-13 07:03:15