Tutorial by Examples

Here's a program which might benefit from refactoring. It's a simple program using C++11 which is intended to calculate and print all prime numbers from 1 to 100 and is based on a program that was posted on CodeReview for review. #include <iostream> #include <vector> #include <cma...
In C++ code bases which used to be C, one can find the pattern goto cleanup. As the goto command makes the workflow of a function harder to understand, this is often avoided. Often, it can be replaced by return statements, loops, functions. Though, with the goto cleanup one needs to get rid of clean...

Page 1 of 1