I\'m trying to return the data pointer from the function parameter:
bool dosomething(char *data){ int datasize = 100; data = (char *)malloc(datasize);
int changeme(int foobar) { foobar = 42; return 0; } int main(void) { int quux = 0; changeme(quux); /* what do you expect `quux` to have now? */ }
It's the same thing with your snippet.
C passes everything by value.