In C/C++ you can initialize a set of variables to the same value by this syntax: a = b = c = 1;
Would this work for malloc
? I.E. something along the lines of:
char *a, *b;
a = b = malloc(SOME_SIZE * sizeof(char));
Would this create two arrays of the same size, but each has its own memory? Or would it assign both arrays to the same place in address space?
If you break down your multiple assign line to single assignment lines, the solution would become more clear to you.
OR