Take the 2-minute tour ×

How do I initialize a new line char in C?

For example, to initialize char A:

char letter = 'A';

How to initialize new line? Like this maybe:

char newLine = '0x0A'?
share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

Use an escape character like this:

char letter = '\n';
share|improve this answer
add comment

I prefer to you read New Line , It's explain completely \n \r and UNIX EOL and WINDOWS EOL.It's very nice.

share|improve this answer
add comment

Your Answer


