Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the '\?' Escape Sequence in D?

Tags:

escaping

d

What is the \? string escape sequence in D?

like image 886
user541686 Avatar asked Jun 12 '11 03:06

user541686


People also ask

What is the '\ n escape character?

In particular, the \n escape sequence represents the newline character. A \n in a printf format string tells awk to start printing output at the beginning of a newline.

Which is a escape sequence?

Character combinations consisting of a backslash (\) followed by a letter or by a combination of digits are called "escape sequences." To represent a newline character, single quotation mark, or certain other characters in a character constant, you must use escape sequences.

What is escape sequence in C?

An escape sequence is a sequence of characters that does not represent itself when used inside a character or string literal, but is translated into another character or a sequence of characters that may be difficult or impossible to represent directly.


1 Answers

It's just to escape ?, a literal question mark.

There really is no reason for it to be in D, but it existed in C and C++ in order to avoid the question mark being interpreted as a Trigraph. D doesn't have Trigraphs, so its inclusion must simply be for some added backwards compatibility with C and C++.

like image 132
Peter Alexander Avatar answered Nov 11 '22 20:11

Peter Alexander