Code: Select all
array<stringw> *someclass::thefunc() {
array<stringw> *ret = new array<stringw>;
u32 i; // I was using u16 but noticed that the [] operator wanted u32
i = 2;
while(i--) {
ret.push_front(list[i]->getName());
}
return ret;
}then to access it:
Code: Select all
u32 i;
stringw node;
nodes = thefunc();
i = nodes->size();
while(i--) {
node = nodes[i]; // This is the line 30 compiler is talking about below
}
delete nodes;
so I tried changing the whole thing to use arrays of wchar_t, yea it didnt like that. So I tried const wchar_t *, so its an array of pointers to const whcar_t's, which compiles fine, seems to run fine (although isnt it odd I can only ever see the 1 element in the debugger even if its supposed to be 2, when the second one is assigned 'data' goes to the second value.
BUT when I try to access it
Hrm so I figured I'd try casting it,1>y:\development\launcher\launcher\cmain.cpp(30) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'irr::core::array<T>' (or there is no acceptable conversion)
This is about where the obsceneties came in.1>y:\development\launcher\launcher\cmain.cpp(30) : error C2440: 'type cast' : cannot convert from 'irr::core::array<T>' to 'const wchar_t *'
Searched around the forums and found 1 other guy with a similar problem where assigning with push_back to an array seemed to overwrite the first element and not create a second. But he rewrote all his code so he didnt have to use the array
I don't have that option unfortunatly.
All I want, is a function that creates an array of strings, or wchar_t or whatever, an array of different strings of text and returns them in some accessible manner. The problem is its an unknown size so rather then loop through them to count them then to parse them I figured I'd try Irrlicht Arrays.
But their driving me nucking futs!
Any help would be appriciated!
I've actually spent like 3hrs arguing with the compiler and the debugger and cannot get it to work, I've tried many many many things I just included my latest forey into it.