error C2440: '=' : cannot convert from 'std::string []' to 'std::string []'
- by Bach
now what is wrong with this code!
Header:
#pragma once
#include <string>
using namespace std;
class Menu
{
public:
Menu(string []);
~Menu(void);
};
Implementation:
#include "Menu.h"
string _choices[];
Menu::Menu(string items[])
{
_choices = items;
}
Menu::~Menu(void)
{
}
compiler is complaining:
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
there is no conversion! so what is it on about?
please help, just need to pass a bloody array of strings and set it to Menu class _choices[] attribute.
thanks