I came up through a strange problem where I had a string wherein it displayed all the characters and numerals without any issues. But the same thing was not possible with an integer array. As far as I know string is a NULL terminated character array. So, what makes strings different to display everything without any discrimination.
Any help is appreciated. Thanks!
The way you instruct the compiler to print them makes them different.
When your write
you tell the compiler that it should treat
charPtras aNULL-terminated string. It looks at the memorycharPtrpoints to and interprets each byte as a character, until it reaches a0.There’s no equivalent for generic array types.