Void function(int x) {
x = 1;
}
Visual studio shows an error that I need a semicolon here: (int x) ^ { I have never seen a semicolon in this place for a function though. What is going on here?
Void function(int x) {
x = 1;
}
Visual studio shows an error that I need a semicolon here: (int x) ^ { I have never seen a semicolon in this place for a function though. What is going on here?
I'm answering my own question here for those who need help with the same issue in the future.
C++ doesn't support declaring/defining normal functions within other functions, such as main(). The only way to do this would be inline functions (lambdas). More information about nested functions can be found here: Can we have functions inside functions in C++?