Presentation is loading. Please wait.

Presentation is loading. Please wait.

Characters and Character Sets tMyn1 Characters and Character Sets The characters that can be used are the upper and lower case letters, A to Z and a to.

Similar presentations


Presentation on theme: "Characters and Character Sets tMyn1 Characters and Character Sets The characters that can be used are the upper and lower case letters, A to Z and a to."— Presentation transcript:

1 Characters and Character Sets tMyn1 Characters and Character Sets The characters that can be used are the upper and lower case letters, A to Z and a to z, the digits 0 to 9, the space character, the control characters for new line, horizontal and vertical tabs, form feed and bell, plus the following special characters: _ { } [ ] # ( ) % : ;. ? * + - / ^ & | ~ ! =, \ ” ’ Those above are also referred to as symbols.

2 Characters and Character Sets tMyn2 The above definition of the characters that are used in C++ does not say how the characters are encoded. On a PC, these characters will typically be represented in the machine by 8-bit extended ASCII codes. Control characters can be entered by means of an escape sequence. An escape sequence is an indirect way of specifying a character, and always begins with a backslash.

3 Characters and Character Sets tMyn3 Escape SequenceControl Character \nnewline \thorizontal tab \vvertical tab \bbackspace \rcarriage return \fform feed \aalert-bell

4 Characters and Character Sets tMyn4 There are some other characters that are a problem to represent directly. For example since the backslash signals the start of an escape sequence, the only way to enter a backslash as a character constant is by using two successive backslashes:

5 Characters and Character Sets tMyn5 Escape SequenceCharacter \\backslash \’single quote \”double quote \?question mark


Download ppt "Characters and Character Sets tMyn1 Characters and Character Sets The characters that can be used are the upper and lower case letters, A to Z and a to."

Similar presentations


Ads by Google