How do we pass an char array as an argument to a callback? When I try to code something like:
void caller(void (*function)(char*), char* string)
{
function(string);
}
void function(char* string)
{
string[0]=data0;
string[1]=data1;
string[2]=data2;
}
void principal()
{
char* str={0};
caller(&function, str);
}
in the debugger watchlist, the string argument behaves like a common pointer (not an array) and the char array does not get populated with data at all. The function "principal" gets called in the main() when certain conditions are met.