I have a simple function in which an array is declared with size depending on the parameter which is int.
void f(int n){ char a[n]; }; i
Would it be reasonable to use a vector<> rather than an array? Or, since you're replacing a char *, a std::string? Those do work well with runtime sizing, although there may be other reasons not to use them.
vector<>
char *
std::string