how to declare an arraywith unspecified length dynamically? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how to declare an arraywith unspecified length dynamically?

for example array of byte for storing images

29th Jun 2017, 2:18 PM
Saeed Noruzi
Saeed Noruzi - avatar
1 Answer
+ 2
If you don't know the size of array, you should use dynamic container. The most appropriate in such cases is vector. Just create vector<char> or vector<int8_t> for the byte array.
30th Jun 2017, 6:15 AM
soman