// prompts the user for a non-negative numbers (>= 0)
// reads in the a number and checks
// keeps re-prompting user if the input is invalid (negative)
void input(int& n, int& n1)
{
do
{
cout << "Please enter a valid non-negative integer:\n";
cout << "1.";
cin >> n;
cout << "2.";
cin >> n1;
} while (n <= 0 || n1 <= 0);
//Stores User input integer into a string
//Dynamically allocates (vertical array) based on string size
stringstream tmp_stream;
tmp_stream << n;
int SIZE = tmp_stream.str().size();
int *vArr;
vArr= newint[SIZE];
for (int i = 0; i < SIZE; ++i)
{
vArr[i] = tmp_stream.str.at(i);
cout << vArr[i] << setw(12);
}
How do I go about Populating the elements in the array created, I keep getting a compiler error on this vArr[i] = tmp_stream.str.at(i); but I am a little lost on how to fix.