you can use vector
#include <vector> ...
int n;
cin >> n;
vector<int> vec(n);
...
int size_of_vector = vec.size();
...
solved char array length c++
you can use vector
#include <vector> ...
int n;
cin >> n;
vector<int> vec(n);
...
int size_of_vector = vec.size();
...
solved char array length c++