C++ Arrays

Revision en2, by the41, 2019-11-22 06:51:37


I recently switched from java to C++ and encountered a question. I notice that everybody seems to use C-style arrays over C++ arrays. To me, it seems that C++ arrays, being easier to pass in functions and with the inclusion of bound checks, would be better, but this does not appear to be the case. Is it because of faster typing or tradition or why does everyone still use C-style arrays? Sorry if the question seems very basic; I searched for a while but could not find an answer.

To my understanding:

int a[3]; //C-style
array<int, 3> a; //C++ style

Thank you!

Tags c++


  Rev. Lang. By When Δ Comment
en2 English the41 2019-11-22 06:51:37 66 Tiny change: 'standing\n~~~~~\ni' -> 'standing\n\n~~~~~\ni'
en1 English the41 2019-11-22 06:48:56 603 Initial revision (published)