I am good in C++ concepts but I'm having hard time in understanding C++ syntax.
Like in this example why ":elem" is written before curly braces.
And this is a different for loop syntax.
Can you guide me where can I learn this type of advanced syntax?
Like in this example why ":elem" is written before curly braces.
PHP Code:
class Vector { public:
Vector(int s) :elem{new double[s]}, sz{s} { }
PHP Code:
for (auto& x : v) ++x;
Comment