what does /n mean?

Recommended Answers

All 4 Replies

/n has no special meaning. But \n is the new line character. The \ is used to start an "escape sequence" that allows you to enter special codes like the following either as a char or as part of a String:

\b (backspace BS, Unicode \u0008)
\t (horizontal tab HT, Unicode \u0009)
\n (linefeed LF, Unicode \u000a)
\f (form feed FF, Unicode \u000c)
\r (carriage return CR, Unicode \u000d)
\" (double quote ", Unicode \u0022)
\' (single quote ', Unicode \u0027)
\\ (backslash \, Unicode \u005c)

You can also use it to encode hex characters as in \x1e.
Example: printf("This is 0x1e as output: \x1e\n");
Note the \n at the end. That's so the new-line is output also. Makes for easier reading.

In simple words Its using for a new line!

yeah, new line. Think of it like a carriage return.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.