DEV Community

sydney
sydney

Posted on

return function

I just discovered that my problem trying to see the fprintf() outputs in a command window were because of the "return" statement in the code! Using the debugger I got a warning about the line # containing the return statement. Noticing that the small example code that did work I noticed that the "return 0" line of code was in the code, so I changed my "return" to "return 0" and all of a sudden the command window now works. Looking at the other code examples from this book on algorithms I see that it uses the "return" statement a lot. Maybe some old antiquated code is in this book vs what the newer compiler is expecting? Maybe the "return" value has a reason to exist, but I have yet found an answer to this. Or why my change made the code work.
syd / wt1v

Top comments (0)