MCQs
-3[ptr]
= -*(3+ptr)
= -*(ptr+3)
= -ptr[3]
= -103 //ASCII value of character ‘e’ is 103
We cannot copy anything using strcpy function to the character pointer pointing to NULL.
Error: since name of array is a constant pointer and can't be altered
%o in printf statement is used to print number in the octal format.
Size of a character array should
one greater than total number of characters in any string which it stores. In c
every string has one terminating null character. This represents end of the
string.
So in the string "Placementadda†, there
are 13 characters and they are ‘P’,’l’,’a’,’c’,’e’,’m’,’e’, ‘n’,’t’,’a’,’d’,’d’,’a’ and ‘’. Size of
array arr is 13. So array arr will store only first 13 characters and it
will note store null character.