0

What does '\xB2' this mean in c++ ??

Actually, I'm encounter this in someone's project

27th Jun 2019, 2:17 PM
Nouman Bin Sami
Nouman Bin Sami - avatar
12 Answers
+ 3
\x will render character that represent its hexadecimal form. for example A has 65 as the character code, and 65 in hexadecimal is 41. so you can use \x41 as A. in this case \xB2 is ²
27th Jun 2019, 2:41 PM
Taste
Taste - avatar
+ 2
each character has its own numeric code/form for computer to be able understand it. we can use this numeric code to represent certain character that we probably cant type by our own, such as ² (exponent 2/superscript 2)
27th Jun 2019, 3:01 PM
Taste
Taste - avatar
+ 1
Taste Will you further elaborate it
27th Jun 2019, 2:54 PM
Nouman Bin Sami
Nouman Bin Sami - avatar
+ 1
Taste but what xb2 is doing in that case
27th Jun 2019, 3:03 PM
Nouman Bin Sami
Nouman Bin Sami - avatar
+ 1
if you print \xB2 it'll render ² in the output
27th Jun 2019, 3:04 PM
Taste
Taste - avatar
+ 1
And what if I want to preempt the user to press ENTER key for further process if he/she press ENTER Key then he/she will be able to continue. what will be the code to do this??
27th Jun 2019, 3:07 PM
Nouman Bin Sami
Nouman Bin Sami - avatar
+ 1
you can use cin.get() if i remember correctly
27th Jun 2019, 3:11 PM
Taste
Taste - avatar
+ 1
Hope you will be right 😅
27th Jun 2019, 3:15 PM
Nouman Bin Sami
Nouman Bin Sami - avatar
+ 1
Taste But what if I want to check whether user press ENTER Key or not
28th Jun 2019, 4:25 AM
Nouman Bin Sami
Nouman Bin Sami - avatar
+ 1
sorry i dobt know that one, try to ask new question. maybe someone else can help
28th Jun 2019, 4:27 AM
Taste
Taste - avatar
+ 1
Okay
28th Jun 2019, 4:30 AM
Nouman Bin Sami
Nouman Bin Sami - avatar