new types may not be defined in a return type



1
2
3
4
5
6
7
8
9
10
11
12
struct state {
       int M_count;
       int C_count;
       bool boat;
       }
int hn (struct state st){
    struct state temp;
    temp = st;
    int tot =  temp.M_count + temp.C_count;
    int hr = 2*tot - 3;
    return hr;
    }


its giving error
new types may not be defined in a return type


what is the problem with my function?Please reply!
You are missing a ; on the end of your struct.
you are awesome!
Topic archived. No new replies allowed.