c++ - Why is the output of following code comes 25448? -
c++ - Why is the output of following code comes 25448? -
when seek run code, gives next output:
c 99 25448 4636795
i want know how compiler generates lastly 2 output?
#include<iostream> #include<stdio.h> using namespace std; int main() { char ch='c'; printf("%c\n",ch); printf("%d\n",ch); printf("%d\n",'ch'); printf("%d","ch"); homecoming 0; }
printf("%c",ch); - print normal character printf("%d\n",ch); - print ascii value of character printf("%d\n",'ch'); - multi-character literal printf("%d","ch"); - print value of pointer string "ch"
regarding 'ch'
25448 0x6368
, 63 hex 'c' , 68 hex 'h'
c++ output
Comments
Post a Comment