How would you write 2M using escape sequence?

closed account (EwCjE3v7)
Hi there
i just wanted to ask how would you write 2M using escape sequence?
its an exercise in my book
A 'M' is \x4d

Edit:
Something i need to make clear.sry for that
like i can write
cout << "2m" << endl;
Last edited on
What do you mean by "2M" ?
@EssGeEich

What do you mean by "2M" ?


Two millions?
closed account (EwCjE3v7)
literally 2M like i can write
cout << "2m" << endl;
but how do i do it in escape sequences and sorry for puttin it in lounge i changed it to Beginners
Last edited on
Literally 2M is "2M" not "2m":) So the assignment is not clear :)
Last edited on
But in any case you should to determine codes of these characters and use them in escape character literals.
cout << "\x32\x4D";
For example if ASCII table is used then escape character literal for 2 will be

'\062'
closed account (EwCjE3v7)
thanks EssGeEich. Thanks
Topic archived. No new replies allowed.