C++ Misc

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/20

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:18 PM on 4/15/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

21 Terms

1
New cards

std::stoi and std::atoi|||std::stoi converts a string to an integer and throws an exception if conversion fails. std::atoi converts a string to an integer but returns 0 if conversion fails, with no error handling.

2
New cards

VLA|||VLA (Variable Length Array) is an array whose size is determined at runtime rather than compile time. While supported in C99, they are not standard in C++, though some compilers allow them as an extension.

3
New cards

Networking in Linux|||Linux networking involves using sockets (created with socket()), binding them to addresses, listening for connections, and using system calls like send() and recv() to transmit data. Key protocols include TCP/IP and UDP.

4
New cards

GCC|||GCC (GNU Compiler Collection) is a free, open-source compiler that compiles C, C++, and other languages. It's widely used in Linux environments and is the default compiler on many systems.

5
New cards

std::erase|||std::erase removes elements from a container. For strings, it removes characters at a specified position or range. For vectors and other containers, it removes elements by iterator or value.

6
New cards

Initializer List|||An initializer list is a standard library feature (std::initializer_list) that allows constructors and functions to accept a variable number of arguments of the same type using brace initialization syntax {}.

7
New cards

Data Member|||A data member is a variable that belongs to a class or struct and stores data for each instance of that class. Also called a member variable or field.

8
New cards

First Member Initialized|||In C++, the first member of a class is the first one listed in the class definition. Member initialization order follows declaration order, not the order in the initializer list.

9
New cards

BENCHMARK Keyword|||The BENCHMARK keyword (from Google Benchmark library) is used to define and run performance benchmarks. It measures the execution time of code snippets.

10
New cards

consteval|||consteval is a C++20 keyword that specifies a function must be evaluated at compile time. If it cannot be evaluated at compile time, it results in a compiler error.

11
New cards

using|||using is a C++ keyword that has multiple purposes: it can introduce a namespace (using namespace std;), create type aliases (using MyInt = int;), or bring individual names from a namespace into scope (using std::cout;).

12
New cards

typedef|||typedef is a keyword used to create an alias for an existing type. For example, typedef unsigned int uint; creates an alias for unsigned int.

13
New cards

C++'s Most Vexing Parse|||The most vexing parse is a quirk where C++ interprets certain declarations ambiguously. For example, Foo bar(); is parsed as a function declaration rather than a variable declaration, which surprises many programmers.

14
New cards

Weak vs noexcept vs none vs basic|||Exception safety levels: weak (operations may fail and leave data in an intermediate state), noexcept (no exceptions thrown), none (no guarantees), and basic (if an exception occurs, the object remains in a valid state).

15
New cards

Four Guarantees of Exception Safety|||The four levels of exception safety are: no-throw guarantee, strong guarantee (all or nothing), weak guarantee (object in valid but unspecified state), and basic guarantee (minimal safety).

16
New cards

Four Categories of Storage Duration in C++|||The four storage durations are: automatic (function scope), static (program lifetime), dynamic (heap, manual lifetime), and thread-local (thread lifetime).

17
New cards

Nested Namespaces|||Nested namespaces are namespaces defined inside other namespaces, creating a hierarchical organization of names. Accessed using the scope resolution operator :: (e.g., OuterNamespace::InnerNamespace::name).

18
New cards

memset|||memset is a C standard library function that fills a memory area with a specified byte value. Often used to initialize memory blocks, though it's generally considered unsafe in modern C++ in favor of constructors.

19
New cards

Logical Operators and Sequencing|||Logical operators && (AND) and || (OR) introduce sequencing guarantees: they evaluate left-to-right and short-circuit (stop evaluating once the result is determined). The comma operator also introduces sequencing.

20
New cards

Sequencing|||Sequencing defines the order in which operations are evaluated in C++. It ensures that certain operations happen before others, preventing undefined behavior from operations on the same variable without intervening sequencing points.

21
New cards

Shared Pointer Control Blocks|||Shared pointer control blocks are internal data structures that manage reference counts and deletion callbacks for shared_ptr objects. Multiple shared_ptrs to the same object share one control block to track how many pointers reference the object.