I think what I am doing is legal, but I am not 100% sure. I have function "A" that sets a pointer from a returned pointer location from function "B".
Also, I thought that a neater method would be if B returned nothing but modified A's pointer's address. Could B malloc some space at a pointer passed to it?Code:void A(void)
{
char *myvar;
myvar = B();
}
char *B(void)
{
char *myvar2;
myvar2 = malloc(100);
return myvar2;
}
If I am unclear, let me know.