how to declare an arraywith unspecified length dynamically? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
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 ответ
+ 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