+ 1
c++ char
Hey guys, So while doing the course i got stuck with char i don't understand it because if i do this char test = 'ab' cout <<'ab'; it prints out a 4 digit number but when i do char test = 'a'; cout <<'a'; it prints a. it's probally super easy but i just don't get it lol hope you guys can help me :). bye
3 ответов
+ 13
maybe it printed out the ascii value of the letters
+ 1
thx i really don't know it yet but i'il find out
0
The char data type is supposed to just be a single character, such as 'a', 'b', or 'x.'
I really don't know how you managed to get a 4 digit number (I'm pretty bad at C++), but you did appear to forget a semicolon after the "char test = 'ab'" line.