First let’s simplify the problem to a Minimal Complete and Verifiable example that duplicates the problem:
int try;
Not much code is required because try
is a reserved word. You cannot use try
in a program without the compiler expecting a try/
catch` block.
Solution: Do not use try
as an identifier. Instead use try_func
or something that describes what is being tried.
Additional note: showData()
needs a return type. Most likely it should be void showData()
solved unqualified id before a friend function [closed]