I know that %s is a string of characters, but I don\'t know how to use it. Can anyone provide me a very basic example of how its used and how its different from char ?
%s will get all the values until it gets NULL i.e. '\0'.
char str1[] = "This is the end\0"; printf("%s",str1);
will give
This is the end
char str2[] = "this is\0 the end\0"; printf("%s",str2);
this is