+ 3

why do i get a error?

Can someone explain the error? https://code.sololearn.com/cGLKUWhYigwU/?ref=app

28th Aug 2019, 9:15 PM
Cat Sauce
Cat Sauce - avatar
6 Respuestas
+ 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
28th Aug 2019, 9:24 PM
Faisal
Faisal - avatar
+ 1
isaac how do i prototype a class
31st Aug 2019, 7:18 AM
Cat Sauce
Cat Sauce - avatar
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
31st Aug 2019, 2:38 AM
Isaac Frank
Isaac Frank - avatar
- 1
find the error and solve it
31st Aug 2019, 7:42 AM
Irfan Ali
Irfan Ali - avatar