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.
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]);
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Oh my. I missed that completely. Thanks a lot.