Category "c++98"

Initialize array based on C++ version and compiler

In C++11 or higher regardless of compiler int myArray[10] = { 0 }; would initialize to all elements to zero. The question is would this also work in C++98 and c

Why does C++'s "using namespace" work the way it does?

All students are surprised by the behavior of C++ using-directives. Consider this snippet (Godbolt): namespace NA { int foo(Zoo::Lion); } namespace NB {

How to find a substring in only a portion of a std::string?

I have a std::string and i want to be able to find text only in a section of it : so i need to specify a start and an end position. In std::string::find() one c

How to find a substring in only a portion of a std::string?

I have a std::string and i want to be able to find text only in a section of it : so i need to specify a start and an end position. In std::string::find() one c