0

Why Is this type conversion don't give output

main() { int i=7; char p; p=(char)i; printf("%c",p); }

21st Jun 2018, 5:28 PM
Dhanaraj S
Dhanaraj S - avatar
4 Antworten
+ 7
your code hasn't error.. just think you give 7 and type-cast to char and on 7 ascii value no digit.. use i=65 and see its print A https://www.asciitable.com/ consider this link for ascii list visualmedia ytb
21st Jun 2018, 5:33 PM
Scooby
Scooby - avatar
+ 5
your code also convert int 7 to char 7 but char 7 has no visual digit that's why it doesn't show in printf.
22nd Jun 2018, 3:55 PM
Scooby
Scooby - avatar
+ 2
thanks mahn.... 😘😘😘
21st Jun 2018, 5:46 PM
Dhanaraj S
Dhanaraj S - avatar
+ 1
bt the way how can i convert int 7 to char '7'???
21st Jun 2018, 5:46 PM
Dhanaraj S
Dhanaraj S - avatar