Monday, 12 August 2013

C++ assigning to an array from an initializer list

C++ assigning to an array from an initializer list

I have been working on a program to display a menu to the screen. It was
working but
void parser() {
parsed[0]=data[position];
for (i=1; i<=Choices; i++) {
for (ii = 0; ii<= Depth-cDepth; ii++) {
incriment += pow(Choices, ii);
}
incriment++;
buff = position + incriment;
parsed[i] = data[buff];
}
cout << parsed;
}
is returning the error:
- invalid types 'std::string [3] {aka std::basic_string<char>
[3]}[double]' for array subscript
Any help would be appreciated, and I know there are similar questions but
I couldn't understand the answers. EDIT: The error is on the line
parsed[i]=data[buff]

No comments:

Post a Comment