Q:

how printf handle character strings

look at the code below
char *p="bayant";  // char pointer
char str[ ] = "bayant"; // char array
printf("%s",p);//here we are passing pointer
printf("%s",str);//here we are passing strings base address

But how it works as we are using same format for a pointer and string?

A:

%s conversion specification requires a char * argument.
In the second case you have an array of char argument, but C rules convert (except in a few cases) an expression of type array of char to type char *.

