Character and string literals - Embedded.com

Character and string literals



To read original PDF of the print article, click here.

Internet Appliance Design

HIDs Up

Dan Saks

C and C++ provide several different kinds of literals: integer literals such as 10 and 0x1C , floating literals such as 1.0 and 6.022e+23, character literals such as 'a' and 'x10', and string literals
such as “ouch!” and “n”. Last month, I examined the integer and floating literals.1 This month, I’ll look
• Integer literals in C can have long long integer types. C++ does not have long long integer types.
• C permits floating literals in hexadecimal form. C++ does not.

Aside from these added capabilities of C, numeric literals are the same in C++ as they are in C.

Not surprisingly, character and string literals are also very similar in C and C++.Click here to download a PDF of full article.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.