Whitespace

Whitespace is a collective name given to spaces (blanks), horizontal and vertical tabs, newline characters and comments. Whitespace can serve to indicate where tokens start and end, but beyond this function, any surplus whitespace is discarded. For example, two sequences

int i; float f;

and

int
  i;

    float f;

are lexically equivalent and parse identically to give six tokens:

int
i
;
float
f
;

Whitespace in Strings

The ASCII characters representing whitespace can occur within string literals. In that case they are protected from the normal parsing process (they remain as a part of the string). For example,

char name[] = "mikro foo";

parses into seven tokens, including a single string literal token:

char
name
[
]
=
"mikro foo"   /* just one token here! */
;

Line Splicing with Backslash (\)

A special case occurs if a line ends with a backslash (\). Both backslash and new line character are discarded, allowing two physical lines of a text to be treated as one unit. So, the following code

"mikroC PRO \

for PIC Compiler"

parses into "mikroC PRO for PIC Compiler". Refer to String Constants for more information.

Copyright (c) 2002-2012 mikroElektronika. All rights reserved.
What do you think about this topic ? Send us feedback!
Want more examples and libraries? 
Find them on LibStock - A place for the code