Indeed, you cannot dynamically read data into a const array.
- - const .
, std:: array...
#include <array>
#include <algorithm>
#include <iostream>
int main() {
std::array<int, 5> writable = {4,3,0,1,2};
const std::array<int, 5> & readable = writable;
std::sort(writable.begin(), writable.end());
for(int i : readable)
std::cout << i << ' ';
}
(. , " , ", . , , , , . -----, , , buuuut... , , . !)