Computer Science Canada expected primary-expression before ?.? token |
Author: | a22asin [ Wed Nov 19, 2014 4:41 pm ] | ||||
Post subject: | expected primary-expression before ?.? token | ||||
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
My Tester class:
|
Author: | DemonWasp [ Thu Nov 20, 2014 3:55 pm ] | ||||
Post subject: | RE:expected primary-expression before ?.? token | ||||
Instead of:
you probably want:
which is the correct syntax for a static method call in C++. Fixing that problem will probably not make your program build. The type of regDieBag[i] is Die*, but Die::rollTwoDie expects Die. |