Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

A character pointer prints the entire character array because it is designed to treat the input as a string of characters and print until it hits a null character ('\0') indicating the end of the string. On the other hand, an integer pointer treats the input as a sequence of integers and only prints the value of the integer it points to. It would require a loop to print the entire integer array pointed to by the integer pointer.