Dynamic char array in c++

I have to input an expression(without space) e.g. <><>>>><<<<. Currently I am doing it with char e[10].
But since the actual expression length can range from 1 to 10^6, I know how to do that with the help of dynamic arrays.
Please support the answer with proper data types.
Thank You.

i would use std::string as it would make it easier
So, if I previously used char e[10],
how would I declare string and what can be the length of each string.
Last edited on
you would use std::string e;
the length of each std::string is theoretically infinite. it supports the following operators: +, +=, ==, !=, and i think > < <= =>
Topic archived. No new replies allowed.