Have you tried compiling it? There's quite a few syntactical liberties in there. :)
char[]* LongArr;
is not valid syntax.
Where does numStr in the constructor come from?
Where does i come from in getInt() ?
new int* int1
new doesn't belong on the left side of that expression
I think some of the ideas are starting to come together, but study some examples from your text or otherwise and take another crack at it.
jonsca
Quantitative Phrenologist
5,621 posts since Sep 2009
Reputation Points: 1,165
Solved Threads: 581
char * longInt = new char[x];
Now longInt is a char pointer pointing to the first element of a container of x number of elements of type char. That means that longInt acts like an array, though technically it isn't an array, but that is a discussion I still don't understand completely. The number x must, in the end analysis, end up being a positive integer, but it could be any positive integer from 1 to the maximum value of type int.
Now in order for longInt to be used like a number you need to be able to convert each element in longInt from a char/digit to an int and back again. That will be another step in your program.
Then in order to do things like add two "longInts" together you need to be able to "carry" a one to another element in the array if the sum of the two "characters" with the same index in each of the two arrays is over 9.
Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396