int a[] = {1,2,}; Why is a trailing comma in an initializer-list allowed?
It makes it easier to generate source code, and also to write code which can be easily extended at a later date. Consider what’s required to add an extra entry to: int a[] = { 1, 2, 3 }; … you have to add the comma to the existing line and add a new line. … Read more