How to print \n?

Quick newbie question.

How do I print "\n" ? I'm writing a program that requires \n to come up on the console ... how do I do it so that it does not go to a new line ?

Thx in advance
A quick google search would have given you the answer. just type "\\n" instead of "\n":

1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
#include <limits>

using namespace std;

int main()
{
    cout<<"\\n"<<endl;
    cout<<endl<<"Press ENTER to continue...";
    cin.ignore(numeric_limits<streamsize>::max(),'\n');
}
1
2
3
4
5
#include <iostream>
int main()
{
  std::cout << "\\n";
}
Ty! Cj , yeah... I found out the answer before I checked this thread again :P As for the last line in your code ... no idea what that means :P

Ty moschops for simlifying it
Topic archived. No new replies allowed.