Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years. ×

C++ Arrays
Difference between en1 and en2, changed 66 character(s)
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:↵
C-style arrays: int a[3];↵
C++ style arrays: array<int, 3> a;

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


Thank you!

History

 
 
 
 
Revisions
 
 
  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)