Iam a lerner of c lanuage
my question is that
compiler take escape seqence /n /a /b etc
here '\' and 'a' are two chareters the the compiler
take as one charecterwhy tell me reason behind it??????
Printable View
Iam a lerner of c lanuage
my question is that
compiler take escape seqence /n /a /b etc
here '\' and 'a' are two chareters the the compiler
take as one charecterwhy tell me reason behind it??????
Because '\n', '\a', '\b' etc represent one character each.Quote:
compiler take escape seqence /n /a /b etc
take as one charecterwhy tell me reason behind it?
well compiler alsoconfuses the / with the \ soit misunderstands itasone character :D
The reason those "escape codes" are uses is that there is no (easy) way to represent characters such as backspace, newline and bell-sound - they are traditionally "unprintable" - so to make them easily visible, the compiler allows the use of '\n' for newline, '\b' for backspace and '\a' for "bell" (or "alarm").
--
Mats