Quote:
Originally Posted by Tech_Khalsa
#Why we use loop to access any int or float arrays but not with character array?
We need to use the loops in both the case to go through each of the elements but in case of scanf / printf it gives us the the special provision of %s hiding behind the going through each elements. I am not sure about the implementations of the functions though.
Quote:
Originally Posted by Tech_Khalsa
#why we need null to terminate string?
We need to make compiler understand that thats it we are done with the number of characters we want in the string and so we use a character and that is NULL.