Get string input from user and print it
Using %s format specifier in scanf, we can get string input from the user.
In scanf we didn’t give &name. Why?
Because string name itself base address of a string.
So, no need to give & operator in scanf while getting string input.
%s in printf
If we give %s to print a string,
It will print every character of a string one by one until it encounters null character ‘\0’.
If it hits the null character, it will stop printing characters.
So, null character is very important in string. Otherwise, it will keep on print data which may show some sensitive data to attackers.
Enter your name