I need to re-structure some code in a program I wrote som time ago
I'd like to reuse my code instead of having to rewrite the lot. That
leads me to my question.
I have the following two pointers:
char ***pppValues;
char **ppValues;
The relation between the two is:
ppValues = *pppValues;
Now I need to rewrite the following statement:
ppValues[index]
So that I have a similar statement with the same value/meaning, but it
must be rewritten to use pppValues instead of ppValues.
I have tried the following statements without luck.
*pppValues[index]
*(pppValues[index])
*(pppValues)[index]
*((pppValues)[index])
(*pppValues)[index]
*((*pppValues)+ index)
None of which provides me with the correct result.
I don't usually have problem coverting my pointers, but im tired and
can't think straight right now.
I'd be very greatful if someone takes the time to help me, as I've
stared myself blind, without getting the correct result.
If i'm som lucky that someone can spot the problem right away, I'd also
like the following statement rewritten. But it ought to be quite easy if
the statement above has been correctly rewritten.
*(unsigned long *)ppValues[index]
Thanks a lot in advance
/Andreas Vinther, Denmark.
I'd like to reuse my code instead of having to rewrite the lot. That
leads me to my question.
I have the following two pointers:
char ***pppValues;
char **ppValues;
The relation between the two is:
ppValues = *pppValues;
Now I need to rewrite the following statement:
ppValues[index]
So that I have a similar statement with the same value/meaning, but it
must be rewritten to use pppValues instead of ppValues.
I have tried the following statements without luck.
*pppValues[index]
*(pppValues[index])
*(pppValues)[index]
*((pppValues)[index])
(*pppValues)[index]
*((*pppValues)+ index)
None of which provides me with the correct result.
I don't usually have problem coverting my pointers, but im tired and
can't think straight right now.
I'd be very greatful if someone takes the time to help me, as I've
stared myself blind, without getting the correct result.
If i'm som lucky that someone can spot the problem right away, I'd also
like the following statement rewritten. But it ought to be quite easy if
the statement above has been correctly rewritten.
*(unsigned long *)ppValues[index]
Thanks a lot in advance
/Andreas Vinther, Denmark.
Comment