So i am trying to call my member function which is static from my main function. However, i get the error `expected primary-expression before "." token`. What does this error mean in terms of my code? and how could i fix it? it shows up both times when i call `rollTwoDie(Die d1,Die d2)` by `Die.rollTwoDie(regDieBag[i], loadedDieBag[i]);` and im not sure why im getting this error. Oh and im not sure if this helps or not, but loadedDieBag contains the derived class object LoadedDie which is derived from the base class Die below.
My part of my Die.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include<iostream>
#include <cstdlib>
usingnamespace std;
class Die{
public:
Die();
Die(int numSide);
virtualint roll() const;
staticint rollTwoDice(Die d1, Die d2);
int side;
};
int Die::rollTwoDice(Die d1, Die d2){
return d1.roll()+d2.roll();
}