cant display "/'

I know it seems weird that I would want to do this but I want to display \ in my programs. I try to use it in cout like so but it won't work for an odd reason.
1
2
3
4
5
6
7
8
9
#include <iostream>

using namespace std;

int main()
{
    cout << "\" << endl;
    return 0;
} 
\ is the escape character. If you want to print it, you will need to escape it:

std::cout<<"\\"<<std::endl;
Thanks.
Topic archived. No new replies allowed.