We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
You missed int* b=new int [a]. b needs to be deleted before it goes out of scope. All in all it's pretty awful sample code with poorly named variables, inconsistent indenting and no comments; but the problem is stupid and not relevant to C++ too.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Variable Sized Arrays
You are viewing a single comment's thread. Return to all comments →
You missed int* b=new int [a]. b needs to be deleted before it goes out of scope. All in all it's pretty awful sample code with poorly named variables, inconsistent indenting and no comments; but the problem is stupid and not relevant to C++ too.