I see that there is quite a bit of difference in the syntaxes of newer versions of compilers. For example, a syntax that works on c++11 doesn't work on c++98.
#include <iostream>
#include <vector>
int main()
{
// Create a vector containing integers
std::vector<int> v = {7, 5, 16, 8};
// Add two more integers to vector
v.push_back(25);
v.push_back(13);
// Iterate and print values of vector
for(int n : v) {
std::cout << n << '\n';
}
}
the above syntax of for() loop doesn't work on c+++98. Also, the vector IN c++98 needs to be initialized first using a constructor. So, should I use the latest versions of the compiler, or stick to the one that my teachers are using?