error: expected unqualified-id before ‘.’ token //(struct)

You are trying to access the struct statically with a . instead of ::, nor are its members static. Either instantiate ReducedForm:

ReducedForm rf;
rf.iSimplifiedNumerator = 5;

or change the members to static like this:

struct ReducedForm
    static int iSimplifiedNumerator;
    static int iSimplifiedDenominator;

In the latter case, you must access the members with :: instead of . I highly doubt however that the latter is what you are going for 😉

Leave a Comment