Step One: Please in future post code using the (CODE) button, which gives lots of good effect for very very little effort. (Please also look for the 'thread is solved' link at the bottom and after the thread is really solved be sure to mark it solved: That, too, gives good effect for very little effort.
The compiler sees thing in the order they are shown in the file. If main() needs to call readmiles() then readmiles() needs to be at least declared (if not defined) before main is seen. For this particular program, just re-order things. For larger programs, you will learn to create a header file that declares functions, classes, etc; then #include that header before the code that uses the declared "things". The body of the function (the implementation, also called definition) can be seen later as long as the linker can find it somewhere.
griswolf
Veteran Poster
1,176 posts since Apr 2010
Reputation Points: 344
Solved Threads: 262
Skill Endorsements: 1
Question Answered as of 2 Years Ago by
frogboy77
and
griswolf