When a simple-escape-sequence like '\n' is evaluated, what would be the result? Is it ASCII 10? How I can show ASCII 10 as a character? Isn't it '\n' again? I am confused! Can someone please help me with the issue?

When a simple-escape-sequence like '\n' is evaluated, what would be the result?

It's evaluated as the platform-dependent character for a newline. For example, on Linux '\n' will be evaluated as LF (ASCII 10) while on Windows it'll be evaluated as CRLF (ASCII 13 + ASCII 10). But it's totally irrelevant unless you're bypassing the standard I/O framework because those translations will be done under the hood. Your program will never see anything except '\n'.

How I can show ASCII 10 as a character?

Just print the value 10 in character context:

printf("ASCII 10: '%c'\n", 10);
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.