COUT display a Forward Slash..

Oct 23, 2015 at 11:27am
Hey everyone, hope you're all ok..

New to this site so hey :)

Just a quick simple question for a friday:

in COUT how do I show a forward slash?

1
2
cout << "1/8th";  // DOES NOT WORK..
cout << "1\/8th";   // LOGICALLY SHOULD WORK BUT COMPILER MOANS.. 


Thanks in advance :)

Paul..
Oct 23, 2015 at 11:38am
THE first line does work...for the second line do this cout <<"1\\/8th";
Oct 23, 2015 at 11:42am
Ah yes, it does work. That's odd, the complier seemed to format it so there were spaces between which i didn't want so i thought it needed an escape character. Thanks all sorted now :)
Oct 23, 2015 at 12:12pm
GLAD to help....................BEST OF LUCK ...and plz mark your post resolved.CHEERS
Oct 23, 2015 at 1:05pm
How do i mark it resolved?
Oct 23, 2015 at 3:41pm
at the top of ur post , there should be an option to mark as solved.
Topic archived. No new replies allowed.