User Tools

Site Tools


cpp

This is an old revision of the document!


2. C++ Language Reference

Programming languages are a tool. While many modern programming languages are designed to be general purpose, some programming languages may be better suited to solve certain problems than others.

When to use C++

When not to use C++

Unlike Python3, it is difficult to argue that C++ is ever a poor choice for a contest problem. Well-written C++ is difficult to beat in terms of runtime efficiency. C++ boasts a well-established standard library of generics through templates, and many competitive programmers are versed in preprocessor macros that make C++ fell more like Python3.

However, for all the benefits of C++, well written Python3 can be generated in fewer keystrokes than is possible in C++ or Java.1) This is due to both the terse syntax, and the lack of any required boilerplate in the most basic program.

Input/Output

Data Structures

Sequential Structures

Non-Sequential Structures

Mathematical Types and Operations

Numeric Types

1)
The standard “Hello World!” in C++ takes can be accomplished in 107 keystrokes (not including editor commands) including the inclusion of iostream, the use of namespace std, typical whitespace/formatting, and C++ streams for output. It is virtually impossible (in any language) to beat the 22 characters of “Hello World” in Python3.
cpp.1533830640.txt.gz · Last modified: 2018/08/09 11:04 by jguerin