Oct 5, 2014 at 8:25pm UTC
Hi I am required to print a sad face using cout and I have no idea how to do so please help me
Oct 5, 2014 at 8:49pm UTC
If you can do the hello-world program, you can do this program too.
Oct 5, 2014 at 9:07pm UTC
Do you mean this:
☺
If so, you just type Alt+9786. Or, for easiness, just copy the smily face above (took me 10 tries to type that, so just copy and paste it into your code, like this:
std::cout<<"☺\n" ;
Or this:
:)
If it's the latter, then just do this in the code:
std::cout<<":)\n" ;
There is a whole bunch of symbols with the Alt+[number] keys. Here is a good source:
http://www.wikihow.com/Type-Symbols-Using-the-ALT-Key
EDIT: Fixed the 2nd code tag
Last edited on Oct 5, 2014 at 9:07pm UTC
Oct 5, 2014 at 9:42pm UTC
Hi I meant like for the smiley face I used the code
cout<<"\x01" ;
but for sad/frowning face I am unable to discover the code therefore I would like to know what is the code use ?
Oct 5, 2014 at 10:01pm UTC
Hi I used the code in the webpage however it prints a question mark symbol
cout<<"\u2639" ;
Oct 5, 2014 at 11:12pm UTC
There is no frowning face for the default code page on PCs.
I would really be surprised if your assignment was just to discover how to print a single character.
I think it much more likely your professor wants you to do some ASCII art with asterisks or something.
Oct 6, 2014 at 12:26am UTC
Hi guys I tired all the suggestion given however it only prints a question mark symbol.
Oct 6, 2014 at 2:30am UTC
Did you read Duoas's response? What is your actual assignment?
Oct 6, 2014 at 3:18pm UTC
@ Techno01: Nice but it's not really "sad". More like... Horrifying. 8^O
Oct 6, 2014 at 3:51pm UTC
Dont worry @cnoeval ,he will be soon ,I have couple ideas :
break his legs ,stole his bike
BIG PS : Notice that he's crying ,that what I call it art of work
Last edited on Oct 6, 2014 at 3:54pm UTC