3 ms·
The point here isn't copy pasting C code into C++ verbatim. The changes needed to translate C code into valid C++ code that does the same are very simple. One c
by redox99 4y ago
The point here isn't copy pasting C code into C++ verbatim. The changes needed to translate C code into valid C++ code that does the same are very simple. One could translate many thousands of lines of C into C++ in an hour.
More so, the point here isn't even translating an existing codebase where small bugs could surface. It's just explaining concepts. None of the C to C++ differences would matter.
If an answer to OPs question was in C, he could trivially convert that C example into C++.