Skip to content

C++ practice problems

C++
Difficulty:
Category:
Tag:

Showing 32 of 32

Status Title Difficulty
A correct program that still fails Easy
A raw pointer owns nothing Medium
auto copies, and does not say so Medium
Braces refuse to lose your data Easy
Erasing while you walk Medium
Exception safety you did not have to write Medium
int is not a width Easy
Owning something raw costs you five functions Hard
Reading text you do not own Medium
Read the diagnostic before you touch the code Easy
Say it in the signature Easy
std::move does not move anything Medium
The accessor that will not let you look Easy
The catch that threw half of it away Medium
The comparison that is always true Medium
The conversion nobody asked for Medium
The copy you did not write Easy
The delete you will forget Medium
The destructor is the whole idea Easy
The gap between new and the smart pointer Medium
The handler that hid the failure Medium
The handle you left in the door Medium
The line that does nothing, twice a second Medium
The lookup that writes Medium
The loop stops having bugs once it has a name Medium
The promise the standard library reads Medium
The vector that moves everything, repeatedly Easy
Two owners, and neither one ever leaves Hard
What gets compiled with your code Easy
What is left after you move from it Medium
Write the guard yourself Medium
Zero is an answer Easy