c++

PanMaster said:
I'm now creating a class where there are two functions. One creates a large integer, the other adds two large integers. How do I get the answer (which is an 256 integer array) outside the function? Before I used to use the & symbol but it won't work with arrays.
The large integers are stored as a long array of signed single numbers of increasing powers of ten, the first number is the length of the array, thus the arrays are around 1Kb in size.

You need to pass a pointer to the array, rather than the array itself. Make sure the array has been allocated via 'new', rather than being on the stack, as this will cause it to be deleted when it goes out of scope.

As mentioned above though, you should look upo the std::vector class.....it will make things a LOT easier....
 
Back
Top Bottom