Hello,
I am just learning C++, I have already learned the concepts through Object Pascal and am now moving onto C++.
My question deals with arrays, specifically dynamic arrays. (please note I might be using Pascal terms).
I have a program that takes and inputs integers from the command line, however, this input stream can be as large or as small as the user wants it to be.
What I want to do is create a dynamic array for the stream to drop the values into so that I can remember the values that were entered into the input stream for later manipulation.
I know in Pascal I could create a dynamic array with no size or any size, then later in the program extend or decrease the length of the array at will. using the
setlength(<arrayname>, <arraysize>); command.
What I am wondering is if there is the a way to do this same thing in C++, so that I don't have to have an array that is infinitly big to start with.
Thanks for your help and for reading!