On Thu, 12 Jun 2008, Lim Hock-Chai wrote:

If I've a function like below:
void logECD_STP3(const char **dataRcv);

What you have above is a function that accepts a pointer to a pointer to a char.

Below compile and work fine:
char * data;
// code that put stuff into data
. . .
logECD_STP(&data);

This works because the declaration

char * data;

defines a pointer to a char. the & symbol means "the address of", so "&data" means "the address of the variable data". Pointers are merely addresses, so since data is a pointer, &data is a pointer to a pointer (i.e. & is the address of where a pointer is stored, or & points to data which points to something else).

How do I do the same thing if I've
UAM * data;

Above you have declared a pointer that points to a variable of type UAM.

// code that put stuff into data
. . .
logECD_STP(&data); <== I got a compile error Function argument
assignment between types "unsigned char* const*" and "struct
uasmgfile**"

You get this error because logECD_STP() accepts pointers to pointers of type char, not pointers to pointers of type UAM.

James Rich

It's not the software that's free; it's you.
- billyskank on Groklaw

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact [javascript protected email address].