+ 1
Can character divided by integer??
5 Respuestas
+ 3
Yeah you can, you don't have to convert it...it is automatically carried out by the compiler
Compiler first converts your char value to the specific ASCII code related to that char variable after that it is being divided. Try it on your own.. YEAHH IT WORKS
+ 2
Yes if you "convert" it to an integer
+ 2
KrOW it's fine 🤨 (I dont mean that)
+ 2
But care has to taken that while using %c specifier the integer value should not exceed 127. But for c++ it plays out a little different. Without a '+' operator character value is printed. ... So to conclude, in character arithmetic, typecasting of char variable to 'char' is explicit and to 'int' it is implicit.
+ 1
Just for precision: i used the word "convert" dont for mean cast (that though the compiler do in automatic its always good to make clear on code) but only for said "you have to treat it like integer" because, logical speaking, its unuseful and illogical divide a char by an int