Programming reference

C++ Functions Reference

Search C++ syntax, standard library functions, containers, algorithms, and engineering programming patterns with concise examples.

Syntax lookup

Find C++ functions and patterns

Filter by function, library, container, programming task, or example syntax.

C++

Best for

Compiled engineering tools

Use C++ for performance-sensitive numerical code, simulation kernels, device interfaces, and reusable libraries.

Watch out

Types and ownership matter

Check integer division, memory ownership, references, const-correctness, and compiler warnings.

Searchable reference

C++ functions, syntax and standard library uses

CategoryCommand / FunctionPurposeExample / Use
Headers#includeImport declarations from standard or project headers#include <vector>
I/Ostd::coutWrite text or values to standard outputstd::cout << value << "\n";
Mathstd::sqrtCompute square root from <cmath>double r = std::sqrt(area / pi);
Containersstd::vectorStore a dynamic sequence of valuesstd::vector<double> x{1.0,2.0};
Containersstd::arrayStore fixed-size arraysstd::array<double,3> p{};
Algorithmsstd::sortSort values in a rangestd::sort(v.begin(), v.end());
Algorithmsstd::accumulateSum or reduce valuesstd::accumulate(v.begin(), v.end(), 0.0)
Filesstd::ifstreamRead data from a filestd::ifstream file("data.csv");
FunctionsreturnReturn a value from a functiondouble area(double d) { return pi*d*d/4; }
ClassesclassDefine a custom type with data and behaviorclass Beam { public: double length; };
ControlforLoop over a range of valuesfor (double x : values) { sum += x; }
Buildg++Compile a simple C++ source fileg++ main.cpp -std=c++20 -O2

How to use

How to use C++ reference patterns

Search by task

task -> command -> example

Start with the task you need, then check the command, function, or shortcut syntax before using it in a real workflow.

Check context

version + module + units

Software behavior can change by version, workspace, add-in, toolbox, shell, or engineering unit system.

Verify output

example -> small test -> real work

Use the examples as starting patterns and confirm results with a small test file, sample model, or known calculation.

Document assumptions

inputs + method + result

Record the inputs, method, version, and assumptions so engineering results can be reviewed later.

Workflow notes

C++ workflow notes

Header

A file included with #include that declares functions, types, templates, and library interfaces.

Container

A standard library data structure such as vector, array, map, set, or unordered_map.

Reference

An alias to an existing object, often used to avoid copying and to express ownership intent.

Template

A generic function or class pattern instantiated for specific types at compile time.

FAQ

C++ Functions Reference questions

How should I use this C++ Functions Reference?

Search by command, function, shortcut, task, or example, then adapt the pattern to your drawing, model, code, spreadsheet, or simulation workflow.

Are the examples enough for production work?

Use them as quick reference patterns. Validate syntax, units, versions, and outputs before using the result in production engineering work.

Why use a searchable table?

Search is faster than scanning long documentation when you know the task but need the exact command, function, or syntax reminder.

Related

Software guides