Usually for loop takes a counter to iterate through the elements. For that you have to initialize a counter, check whether the counter is less than the total element count, then take element from the container and use use it and increment counter.
C++
If you have a vector and you need to fill it with some predefined data, we have to call push_back() with those data that many times. Its so tiring like the following.
Suppose we have a base class with one virtual function and releasing it to the clients. The user of this class can write a derived class. There he can override the base class virtual function. But accidentally he wrote a wrong parameter type like the following code sample. What will happen?
For a long time I used to develop and maintained C++ applications. Sure the version is 98. But lot of things are happening in C++ community that I was not aware of. Now I got some free time I noticed those changes. The big change was a set of new standards are got approved(C++11. C++14) and few standards are waiting for approval.