-1

In the following statement:

char *myarray[] = {"Amir"};

For pointer myarray[], how many bytes of memory has been allocated?

ishan
  • 47
  • 3
  • 10
Abdul Rahman
  • 1,547
  • 2
  • 20
  • 36

1 Answers1

1

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.

Kunal Puri
  • 3,351
  • 1
  • 9
  • 22