Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how to create array with not constant size in cpp

size_t n;
std::cin >> n;
int* arr = new int[n];
...
// Control flow must reach exactly one corresponding delete[] !!!
delete[] arr;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #array #constant #size #cpp
ADD COMMENT
Topic
Name
6+9 =