Hey guys, I am trying to pass a struct from main function to a class constructor and want to access it. But it's not working. It's saying "error: invalid use of incomplete type 'struct SS'"
You need a "forward reference" of struct SS in Patient.h:
1 2 3 4 5 6 7 8 9 10 11
#ifndef PATIENT_H
#define PATIENT_H
struct SS; // tell the compiler that struct SS actually exists (somewhere)
class Patient
{
public:
Patient();
Patient(SS&); // don't need the word 'struct' here
...
BTW, what's up with the anonymous struct object pmv?
What's the point?
I put "struct SS;" in my header file like you say. And this should automatically include it in my "Patient.cpp".
But I am still getting the same error :(
both the &sObj and &ss are the same but can't access struct members.