thanks, also recommend to read "What do people find difficult about C pointers?" http://stackoverflow.com/questions/4025768/what-do-people-fi...
void foo(int *p)
{
/* assignment won't be persistent after foo() returns; need to send **p */
p = (int *)malloc(1024 * sizeof(int));
}
Not sure why my brain had decided to make an exception for pointers for the rule that all variables are passed as copies when I first learned C, but after that I never had any problems.