C++ Arrays

Правка en2, от the41, 2019-11-22 06:51:37

Hello,

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!

Теги c++

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский the41 2019-11-22 06:51:37 66 Tiny change: 'standing\n~~~~~\ni' -> 'standing\n\n~~~~~\ni'
en1 Английский the41 2019-11-22 06:48:56 603 Initial revision (published)