+ 3
why do i get a error?
Can someone explain the error? https://code.sololearn.com/cGLKUWhYigwU/?ref=app
6 Réponses
+ 6
You need to declare functions before main() if you want to use them inside of it, so just moving rnum in between lines 7 and 9 should work
+ 1
isaac how do i prototype a class
0
If for some reasons you prefer the main() function being at the top
then all you have to do is prototype the function u want to use in the main
just add this *void rnum();* above the main function
and then, u can define it wherever u want after the main function
void rnum();
int main() {....}
void rnum(){.....}
This should work
https://code.sololearn.com/cWOLgOxOOq0W/#cpp
- 1
find the error and solve it