(Putting the "struct" before some struct in C++ is optional - unlike C. It forward-declares the struct "in place". You can declare a stuct as many times as you want. "state" is already defined in line 5, so it's a useless forward declaration.)
The problem at hand here is the typo in line 36 and 43. temp.*parent should most probably be *temp.parent. You want to assign "st" to the place where "temp.parent" points to, right?
(For an interpretation of the error message: There is an operator.*() in C++. It's calling an member function pointer. Your compiler thinks when reading "temp.*parent" that you are going to call a member function pointer to the function stored in the local variable "parent" using "temp" as a this-object. But you don't have any "parent" in current scope, hence the strange looking error.)
(Putting the "struct" before some struct in C++ is optional - unlike C. It forward-declares the struct "in place". You can declare a stuct as many times as you want. "state" is already defined in line 5, so it's a useless forward declaration.)