Sorry for triple posting, but my arrows wont show:
std::vector(ARROR_TO_THE_LEFT)Image*(ARROR_TO_THE_RIGHT) m_Images;
pointer problems :(
Quote:Original post by Anonymous PosterQuote:Original post by ErUs
i just realised something silly :(
-
word * tptr = new word [ words[curword].wordsbefore ];
-
i dont want to be allocating new memory :( i want to point to the words allready in the memory :(
what is the defualt type for a pointer? UINT?
That made no sense what-so-ever. A pointer can be of any type, why UINT? UINT is an unsigned int, which isnt a pointer unless you make it UINT*.
on intel32 machines a pointer is usually 32 bits and so are ints...
but it doesnt make much sense to say
int i;
i = (int)&someObject
doSomeThingWithObectPtr( (Object*)i );
just declare a pointer
word *wordptr;
and set it to the address you want
wordptr = &some_word; wordptr = name_of_word_array;
Could you explain exactly what it is you want to do? Do you want to work with a list of phrases, or something different? Currently, your code looks like you're making some kind of tree. Is this the effect you want? A little more elaborate description wold help.
Do you mean something like this:
TYPE** p = new TYPE* [NUMBER_OF_ELEMENTS];
p[x] = &a
...
delete[] p;
?
TYPE** p = new TYPE* [NUMBER_OF_ELEMENTS];
p[x] = &a
...
delete[] p;
?
Quote:Original post by ErUs
lol. im gonna stop with all the unsafe-ness and re-write with the stl :)
Thats always a good idea.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement