Is there a problem with the use of int* when declaring an array?

Revision en1, by i_alimuhammad, 2022-11-23 21:05:23

I searched but I didn't get an answer. I used it and in my mind, that way of declaration will initialize my array with zeros but in some cases, it didn't. ex. (int* arr = new int[n])

This is my attempts of the problem using new [] (it's just a try to see what the wrong with new []): https://codeforces.me/contest/469/submission/182279769

The same with vectors: https://codeforces.me/contest/469/submission/182281499

Thanks.

Tags vector, dynamic array

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English i_alimuhammad 2022-11-23 21:05:23 507 Initial revision (published)