Need help with function calls
Ok, so after about 2 hours of searching and beating my head against the wall I decided to just ask. I am having problem with a program I am trying to write, I have 2 classes, a double linked list class to hold each digit for large numbers. And a big int class which uses the list class to perform arithmetic on the large numbers. Anyway, I am having trouble using some of my functions in the DList class in any of the functions in the Big Int class.
Specifically with the line
Code:
int size = list.size;
I keep getting the error aggregate value used where an integer was expected.
I know it is not a problem with my size function in the list class as it works perfectly when called from main, it just has this problem when called from the other class.
I have also posted the code where this call is used and the header. Any and all help would be greatly appreciated
Code:
class BigInt : public DList
{
public:
BigInt();
~BigInt();
//BigInt toBigInt(DList list);
void toBinary(DList list);
//void toDecimal();
private:
DList binarylist();
DList intlist();
};
Code:
void BigInt::toBinary(DList list)
{
int temp;
int size = list.size;
for(int i=0, y;i<size;i++)
{
y = 8;
temp = list.at(i);
for(int x=0;x<4;x++)
{
if(temp >= y)
{
temp -= y;
binarylist.at(i+x) = 1;
}
y /= 2;
}
}
}