C
Programming and Technical
Programming
Technical
main()
{
char *str = "12345";
printf("%c %c %cn", *str, *(str++), *(str++));
}
Read Solution (Total 4)
-
- We will get a garbage value printed as the output.
EXPLANATION: *str indicates the value stored at the address in str, So str++ is the incremented address of str,which points to a memory location containing any random/garbage value.
So *(str++) will print that garbage value. - 9 years agoHelpfull: Yes(1) No(0)
- 9 years agoHelpfull: Yes(0) No(0)
- o/p : Error
Reason : We can't change the base address of the string. - 9 years agoHelpfull: Yes(0) No(0)
- output will be:
3 2 1
because it is stack operation.it operates on LAST IN FIRST OUT and it is evaluated from
RIGHT to LEFT. - 9 years agoHelpfull: Yes(0) No(1)
C Other Question