a function-definition is not allowed here before '{' problem

Each { needs a friend }