-2

Looking at the following Code:

char* c = (char*) malloc(sizeof(char)*BUF);

I know that doing

printf("%c\n", *c);

gives me the first character in the string. Also,

printf("%s\n", c);

prints the whole string, where c is the address of the first character. However, what is the meaning of &c? Is it the address of the address? Thanks in advance!

Staki42
  • 125
  • 1

1 Answers1

2

&c is the adress of your variable c (which itself contains the adress of your allocated array).

rom1v
  • 2,752
  • 3
  • 21
  • 47