Simply, if I were to do:
typedef char arrayOne[10];
and in main:
char arrayTwo[10];
would malloc(sizeof(arrayOne))
take more memory than malloc(sizeof(arrayTwo))
?
Or in other words; I'm using typedef to keep the code more simple, but is it worth it or I should just forget it because it uses unnecessary extra memory?
There's no relation between memory allocation & typedef
. The keyword typedef
simply creates aliases to make the long name datatypes into shorter & more meaningful to read.