source.cpp: In function βint main()β:
source.cpp:4:1: error: a function-definition is not allowed here before β{β token
4 | {
| ^
Why do this error keeps coming even after checking syntax many times
source.cpp: In function βint main()β:
source.cpp:4:1: error: a function-definition is not allowed here before β{β token
4 | {
| ^
Why do this error keeps coming even after checking syntax many times
Okay you need to define your functions outside of main()