No of visitors who read this post: 1412
Category: C++
Type: Question
Author: Wood Rebeca
No votes yet

What is the "/n" meaning in the C++.

How and where I can use "/n".

And also want to know what is the correct syntax on "/n".

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

# Comment Id: 58269

Hi Rebeca,

‘/n’ in c++ is a constant meaning "newlines"

It can be used when you want to break a sentence so that the next word starts in a new paragraph i.e new line. Something to know about \n is that it does not flush the output bufferBelow is an example of how you can use it while writing your code:

I hope this helps you

# Comment Id: 58384

Hi Rebecca,

The meaning of "/n" in C++ is a NewLine Character IE it causes the next lot of output to start on the next line down

 This applies to output to printer, or screen Example printf ("Some sort of string of chars /n/n A new line of Characters to print or display )

Will Display/print as follows

Some sort of string of chars

A new line of Characters to print or display

Syntax Print/Printf/( ...../n ...) or any function that send output to the screen or printing device

Can be used on its own or in conjunction with any printable or displayable data and as many time as required.


# Comment Id: 58392

Hi Rebecca,

TIn C++ the "/n" is the Newline or Carriage Return Character

When you output data and include the "/n" it instructs the cursor or printer to move to the beginning of the next line. You may download the sample code that attached below.

I hope this is helpful.

Eaan Rickchard