Here's all the major new C and C++ visualizer features we added in 2026 (most were done in November). Now C++ works much better than before. Each "see it" link opens an example in a new tab.
For what the visualizer could already do, see How the Python Tutor visualizer can help students in your C or C++ courses.
User input
- C programs can read user input with functions like
scanf,fgets, andgetchar, then show how much text it has processed so far at each step. see it - C++ programs can read user input, with
cin >>,getline, and others. see it
C++ string, vector, and other library types
std::stringis shown as its text in quotes. see itstd::vectorshows an array of elements, along with its size and capacity. see it; vectors can also hold compound objects and nested vectors.std::arrayis drawn as the array it holds. see itstd::bitsetshows its bits. see ittuple,optional,variantshow what they hold. see it- Iterators are shown as arrows to their elements. see it
- Smart pointers (
unique_ptr,shared_ptr,weak_ptr) are shown as arrows withuse_count. see it - Lambdas are shown when passed into functions like
std::sort. see it
C++ object-oriented programming
- Constructors and destructors now show
thisand other parameters. see it - Inherited members show up, also with multiple and virtual inheritance. see it
- Static members appear with globals. see it
- A base-class pointer shows the object's real class. see it
- Destructors show properly, even within arrays of objects. see it
C++ pass by value, reference, etc.
- An object passed by value shows up as a copy in the called function. see it
- References are labeled "reference to", and temporary values they refer to get own box. see it
- References and const references passing into functions such as a
const vector<int>¶meter. see it - Move semantics and rvalue references also work. see it
- Exceptions show with arrow going from
throwtocatch, and caught exception shows message. see it
Newly-supported C functions and data types
sqrt,pow, and the rest ofmath.hwork now. see it- Variable-length arrays. see it
- Arrays sized by
const intvariables. see it - Flexible array members at the end of structs. see it
- Bit-fields, each labeled with its width. see it or see its bits
- Enums and bools shown as names like
GREENandtrueinstead of numbers. see it - Complex numbers and 128-bit integers. see it
long doublevalues are now shown. see it- Function pointers show the name of their function. see it
Pointers and memory
- "don't show lone heap object as array" is a new C/C++ detail checkbox under the visualization. Checking it draws a single-value heap block as that value. see it
- Every pointer now points where its type says, such as to a precise struct/union member. see it
- Linked lists with
typedefnodes draw properly. see it - A stack buffer overflow visibly changes the variable next to it to show bug. see it
Function calls and other control flow
- Return values: when a function returns, its frame shows the return value (it wasn't able to do so until now!) see it
- Parameters get their values at a function's first step instead of
?, which makes function calls less jarring to see. see it - Static local variables appear with globals and persist across different calls to the same function. see it
- A loop written on one line takes one step per iteration. see it
- The end of a C++ scope no longer jumps back up through each declaration to show destructor runs, since that looked confusing. see it
Remaining limitations
A detailed list is at C and C++ known limitations. For instance:
map,set,list,deque,stack,queue, and theunordered_containers are shown as empty boxes.- There's no way to signal the end of input, so
while (cin >> x)keeps asking for more user input. std::function, lambdas stored in variables, and pointers into astd::stringaren't drawn well.- Most C++20 features don't compile with gcc 9.3.