What does my professor's project mean and how do I solve?

I don't understand any of the problem and have no idea how to begin. Could someone give me a suggestion and tell me what I am supposed to do here?
To overcome integral size limitation (INT_MAX, DOUBLE_MAX, etc) we want to devise a programmatic scheme to store a number that can be VERY LARGE. To do that we have a positive number (N > 0) whose digits are stored in a vector. For instance 123 is stored as {1, 2, 3} in the vector. 54321 is stored as {5, 4, 3, 2, 1} in the vector.



Write the following function that simulates ++N by taking in its vector representation as the function parameter. The function returns the result of ++N in its vector form:

vector<int> plusPlusN(vector<int> v)

Examples:

input: {1,2}

output: {1,3}



input: {0}

output: {1}



input: {1}

output: {2}

The problem he is addressing is that the basic type int has a limit on how large it can be. If int is 32 bit, it can't be larger than 2^32. But what if you want to store a number bigger than that?

He proposes that you make a vector of int values, and store the number in that vector. So if you had the number 31, you would store than in a vector that had two ints in it. The first int would be 3, and the second int would be 1.

Do you understand this?
Topic archived. No new replies allowed.