i had a little problem trying to pass the address for a character array to a function, here is a simple example of what i am trying to do :
char a[20] = {"hello"};
printit( &a );
can you please give me the declaration of he printit function ( and maybe why ), i was expecting something like :
void printit( char ** value );
or void printit( char * value[] );
to work, but it is not.
*Error messages :
void printit( char ** value ); => cannot convert parameter 1 from 'char (*)[20]' to 'char **'
void printit( char * value[] ); => cannot convert parameter 1 from 'char (*)[20]' to 'char *[]'
thanks in advance.
Regards, max.
void printit (const char* str);. It is not clear to me whether printit is your own user-defined function or part of a library, however.&tis a pointer to the array as whole, henceint (*)[10]