C++ Typing Practice

Master C++ syntax with real-world code examples. Practice typing C++ code to boost your development speed and reduce syntax errors.

Start C++ Practice

Why Practice C++ Typing?

Pointers and References

Master the * and & operators, along with the arrow -> operator.

Templates

Practice template<typename T> syntax for generic programming.

Smart Pointers

Get familiar with unique_ptr, shared_ptr, and weak_ptr.

Namespaces and Scope

Smoothly type namespace and :: scope resolution operator.

Common C++ Syntax

Practice these common C++ syntax patterns for smooth coding:

  • std::vector<int> vec;
  • template<typename T>
  • std::unique_ptr<Node>
  • namespace::function()

Why practice typing C++ code?

C++ adds a thick layer of syntax on top of C. Besides pointers and semicolons, everyday code is full of std:: prefixes, << stream operators, angle brackets for templates, references with &, lambdas with capture lists and range-based for loops. Each of these is a multi-character token, and many of them need Shift, so modern C++ is one of the most symbol-heavy languages you can type.

Practicing real C++ snippets trains your hands on the patterns you write every day: std::vector<int> v;, std::cout << x << '\n';, for (const auto& item : items) and [&](int x) { return x * 2; }. When these flow automatically, you spend less time fixing slips like a single colon instead of ::, or a missing > at the end of a nested template, and more time on design and correctness.

DevType's C++ problems range from Level 1 (short declarations) to Level 5 (complete feature implementations). Auto-indent fills in the leading whitespace and it is not counted, so you can focus on the tokens themselves. Use the keyboard guide while you learn the symbol positions, then the pace caret and the AI typing analysis to build speed once your accuracy is stable.

Symbols you type often in C++

::

Scope resolution operator (namespaces, static members, out-of-class definitions)

On US (ANSI), : is Shift+; so :: means holding Shift and tapping ; twice. On a Japanese JIS keyboard, : has its own key to the right of ;, so no Shift is needed, but the right pinky still taps twice. On US, don't release Shift between the two colons or you will type :; instead.

std::

Standard library namespace prefix

Type it as a single word. s, t and d are all left-hand keys and the colons are under the right pinky, so the hands alternate nicely. In code that uses std:: everywhere, this one prefix makes up a large share of your keystrokes, so it pays to make it automatic.

<<

Stream insertion (std::cout) and left shift

Shift+, on both US and JIS. Hold Shift and tap twice. Most code puts a space on both sides, as in std::cout << x, and DevType counts those spaces, so build the habit of space, <<, space.

>>

Stream extraction (std::cin), right shift and closing nested templates

Shift+. on both layouts. Since C++11, nested templates such as std::vector<std::vector<int>> can end with >> directly, so keep count of the angle brackets you opened and close all of them.

template <typename T>

Template declaration

Only < and > need Shift; the keywords don't. Learn the whole line as a fixed phrase. Then watch the places where templates are used, such as std::max<T> or std::map<std::string, int>: every < must be closed.

&

Reference (int& x), address-of, and && for rvalue references and logical AND

US: Shift+7. JIS: Shift+6. const auto& and std::string&& appear often. For &&, keep Shift held and tap twice. Pay attention to whether the snippet puts & next to the type or next to the name.

->

Member access through pointers, smart pointers and iterators; also trailing return types

A hyphen followed by Shift+. on both layouts. You type it with raw pointers, std::unique_ptr, iterators such as it->second, and in declarations like auto f() -> int. Practice the hyphen and > as one motion.

[&](int x) { }

Lambda expression with a capture list

A lambda uses all three bracket types in a row. On US, [ and ] are unshifted to the right of P, ( and ) are Shift+9 and Shift+0, and { } are Shift+[ and Shift+]. On JIS, [ is to the right of @ and ] to the right of :, and ( and ) are Shift+8 and Shift+9. Practice the shape square, round, curly as one sequence.

for (auto& x : v)

Range-based for loop

A single : with spaces on both sides separates the element from the range, not ::. On US it is Shift+;, on JIS it is the unshifted key to the right of ;. Watch the switch from & (Shift) to space, then :, then space.

nullptr

Null pointer literal

All lowercase, no Shift. The double l and double p are easy to drop or triple when you go fast, so type it as one word rather than letter by letter. Modern C++ uses it instead of NULL or 0.

C++ typing data on DevType

Median speed
23 WPM
Top 10% speed
36 WPM
Average accuracy
90.8%

Most mistyped symbols

  1. 1.\
  2. 2.&
  3. 3.]
  4. 4.[
  5. 5.-

Based on C++ plays on DevType as of November 2026. Plays shorter than 5 seconds are excluded. The numbers are updated as more records come in.

Common typing mistakes in C++

A single colon instead of ::

Fast typists often produce std:cout or std;:cout, especially on US keyboards where Shift is released too early. Lines that also contain a colon inside a string make it worse. Hold Shift through both colons, and slow down slightly on lines that mix : and ::.

std::cout << "total: " << total << '\n';

Unbalanced angle brackets in templates

Nested templates require you to count < and >. Dropping one > at the end of a nested map type is a typical slip, as is forgetting the space after a comma. Before typing the closing >>, check how many templates are still open.

std::map<std::string, std::vector<int>> index;

Mixing up . and -> with smart pointers

A std::unique_ptr uses -> to reach the object it owns, but . to call its own member functions such as reset() or get(). Fingers that only know one form will slip here. Look at what you are calling before you type.

auto p = std::make_unique<Node>();
p->value = 42;
p.reset();

Getting the lambda bracket order wrong

Lambdas go square, round, curly: captures, parameters, body. Common slips are starting with ( out of habit, or forgetting the semicolon after the closing brace when the lambda is assigned to a variable. Read the whole statement before you start typing it.

auto square = [](int x) { return x * x; };

Forgetting the semicolon after a class

Like C structs, class and struct definitions end with };. Together with access specifiers such as public: and private:, which use a single colon, the end of a class is a hotspot for mistakes. Treat }; as one unit for every class.

class Counter {
public:
    void add() { ++n_; }
private:
    int n_ = 0;
};

Tips to type C++ faster

Type std:: as one motion

Instead of five separate keystrokes, think of std:: as a single word. The same applies to other frequent prefixes and names such as std::vector, std::string and std::make_unique. Once they are automatic, long C++ lines feel much shorter.

Practice symbol shapes

C++ has recurring symbol clusters: ::, ->, <<, &&, <>, and the lambda shape [&](){}. When one of them makes you hesitate, retry the same problem with Tab+Enter and focus only on that cluster until it flows. Press Esc to move on to a new problem.

Set your layout and use the keyboard guide

Select your physical layout (ANSI, ISO or JIS) and your logical layout in Settings. The keyboard guide then shows the right keys and fingers for symbols like : and &, whose positions differ between US and JIS keyboards.

Use the opposite Shift key

Most C++ symbols need Shift: :: on US, <, >, &, parentheses, braces and quotes. Pressing Shift with the hand opposite the target key keeps your hands balanced and reduces errors when shifted keys come in quick succession.

Turn the analysis into drills

The AI typing analysis on the result page shows your weak keys and fingers. Ask the AI problem generator for C++ snippets that emphasize those symbols, such as templates or lambdas, or upload code from your own projects as custom problems.

C++ typing practice plan

  1. 1

    Step 1: Levels 1-2 for accuracy

    Start with short declarations and simple statements. Aim to finish with almost no mistakes, even if you are slow. Concentrate on ::, ;, and the angle brackets, and make sure you never release Shift halfway through a doubled symbol.

  2. 2

    Step 2: Level 3 for templates and streams

    Once Levels 1-2 feel easy, move to Level 3, where method calls, streams and templates appear more often. Retry problems with Tab+Enter until lines like std::cout chains and std::vector declarations come out without pauses.

  3. 3

    Step 3: Levels 4-5 for full functions and classes

    Longer snippets combine classes, lambdas, range-based for loops and smart pointers. Keep accuracy as the main goal and watch the transitions between bracket types. If errors increase, return to the previous level for a few rounds.

  4. 4

    Step 4: Build speed with the pace caret

    When your accuracy is steady, enable the pace caret in Settings → Play Screen and set a target slightly above your current WPM. Raise it little by little. Use replays and the AI analysis to find where you slow down, and use rankings and badges to track your progress.

C++ code examples

Each example has a line-by-line explanation and can be practiced right away (practice results are not recorded in the rankings).

Level 2

C++ typing practice FAQ

Is C++ harder to type than C?

Usually, yes. C++ keeps all of C's symbols and adds ::, templates with angle brackets, references, lambdas and stream operators. That means more shifted keys and more bracket pairs to keep balanced, which is why focused practice on these tokens pays off.

Should I practice with std:: or with using namespace std;?

Practicing with std:: is more useful, because explicit std:: is the common style in real-world code and headers. In DevType, simply type the snippet exactly as shown, prefixes and spaces included.

Is a US or a JIS keyboard better for C++?

Either works. On JIS, : has its own key, so :: needs no Shift, while = and the quotes sit in different places than on US. On US, the brackets are grouped to the right of P. The best choice is the keyboard you use every day, with the correct layout selected in DevType so the guide and analysis are accurate.

Does typing practice help with competitive programming or coding interviews in C++?

It helps with the mechanical part. Contest and interview code is full of std::vector, range-based for loops, lambdas and templates. When these come out without errors, you can spend your time and attention on the algorithm instead of fixing typos under pressure.