Changing classes

Hey all,
1
2
3
4
5
6
7
8
9
10
11
int main()
{
    Casual::Casual(001, "Jerry Seinfeld", 250, 40);
    StaffMember* SM1 = new Casual(001, "Jerry Seinfeld", 250, 40);
    StaffMember* sp = Casual* cp;
    cout << SM1.wage()
    
    
    system("PAUSE");
    return 0;
}


i've gotta get the line below the bold line to use 'Casual' functions, but it keeps saying *cp is undeclared in the line i've put in bold.
this was a line i was told to use a while back - i'm using polymorphism.
Tell me...where did you declare *cp? You can't create an object like that then immediately assign it. You need to declare *cp before you use it in anything (with the exception of initialization).
Topic archived. No new replies allowed.