I have a struct that I want to fill out in a separate source file from where I am running main. In the header file I included the extern but when I go to define the variable in a source file it doesn't work.
    //This is a header file
    struct example {
         int data1;
         float data2;
         bool example;
    }
    extern example tmp;
And then in a source file:
example *tmp = new example;
I'm getting the error "Expected unqualified-id". Why is that?
 
     
    