Video Coming Soon...

Created by Zed A. Shaw Updated 2024-11-15 13:50:32

04: The Names of Funny Characters

If you're already familiar with the names of characters used in programming then you can safely skip this exercise. If you're new to programming then it'll help if you know the name of the characters used in C++.

CharNameCharName
_underscore*asterisk
{left-curly-brace+plus
}right-curly-brace-minus
[left-square-bracket/slash or divide
]right-square-bracket^caret
#hash or pound&ampersand or and
(left parenthesis?question mark
)right parenthesis~tilde
<less-than!exclamation or bang
>greater-than=equals
%percent,comma
:colon\back-slash
;semi-colon"double-quote
.dot or period'single-quote

One character not included in the list is | (pipe) because the Markdown formatting library I use is really bad at processing escapes inside tables, and uses | for its tables.

How They're Used

While the characters have names, they're used in C++ to create meaningful operations. Don't worry about memorizing this list yet, but keep it in mind and when you run into something you don't recognize come back and look it up. If you can memorize it now then you'll have an easier time later reading C++ code.

SymbolNameSymbolName
::scope resolution+addition
//line comment-subtraction
/*multi-line comment*multiply
*/end comment/divide
->pointer access%modulo
&&logical and<<bitshift left
=assignment>>bitshift right
!logical not&bitwise and
<=less-than-equal(start call
>=greater-than-equal)end call
==is equal^bitwise xor
!=not equal~tilde
<less-than{left-brace
>greater-than}right-brace
++increment--decrement

Once again, because of the formatting library I use I can't include the | (pipe) based operators so here's what's missing:

Don't worry too much if these don't make sense. Just get familiar with them, and come back as you run into these characters in later exercises.

Number Formatting

You can write numbers in various formats, most of which you may not use for a while.

String Formatting

A "string" in C++ is any text that you want to display or transmit that isn't code. You'll get plenty of practice with strings since they're a big part of what software processes, but just remember you have to format your strings like this:

"This is a string."

That's it, just "wrap" your words in " (double-quote) and C++ will know this isn't code, it's text.

Further Study

Many programmers will tell you this nonsense that memorizing anything will not help you. The reality is that they definitely memorize the names of these characters, they just did it in a disorganized organic way. They beat their head repeatedly on code until they learned the names through constant exposure.

So, you can actually skip memorizing these, and you'll eventually learn these names as you try to work through the code and have to refer back to this list. Just move on, keep this list in your bookmarks, and come back when you see a character you've never seen.

If you spent some time doing a little bit of memorization now you would save yourself some time later. By knowing the names of these characters and the quick descriptions of what they do, you'll be ready when you run into them. They won't make much sense now, but later when you read them, you'll only have to focus on what they do, not what they do and what they're called.

Previous Lesson Next Lesson

Register for Learn C++ the Hard Way

Register to gain access to additional videos which demonstrate each exercise. Videos are priced to cover the cost of hosting.