[Solved] c++ – How to use a function in a Struct?


You must declare func2 before newNode. Forward references are not possible.

possibly, you DID declare func2 before but it had a compile error itself, please check further above in the log.

By the way, newNode is not “the struct”. “The struct” is that variable what you have named node and is not declared, which does not matter because you have no reference to its contents.

2

solved c++ – How to use a function in a Struct?