Why do we not pass the address of the string during printf or scanf functions like we do for Integer or float variable types?
Thanks in advance.
Printable View
Why do we not pass the address of the string during printf or scanf functions like we do for Integer or float variable types?
Thanks in advance.
But you DO pass an address.
You just don't use the & address-of operator.
Code:char message[] = "hello";
printf("%s",message);
// is the same as
printf("%s",&message[0]);
Oh my. I missed that completely. Thanks a lot.