In the following statement:
char *myarray[] = {"Amir"};
For pointer myarray[], how many bytes of memory has been allocated?
In the following statement:
char *myarray[] = {"Amir"};
For pointer myarray[], how many bytes of memory has been allocated?
It depends on the OS Architecture. Because it is an array of char *
, It will take size equivalent to one pointer in this case.
For 32-bit addressing, it will take 4 bytes.
For 64-bit addressing, it will take 8 bytes.