jurij
jurij

Reputation: 383

Initializing new line character in C language

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'?

Upvotes: 0

Views: 2485

Answers (2)

PersianGulf
PersianGulf

Reputation: 2935

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

Upvotes: 0

Ernest Friedman-Hill
Ernest Friedman-Hill

Reputation: 81684

Use an escape character like this:

char letter = '\n';

Upvotes: 6

Related Questions