Unfortunately, the only way to really catch logic errors is by using the program. After you compile the application, you should then test it to see that the program is functioning as it should. As you find logic errors (or as logic errors are reported by others), it is a matter of poring over the code to find where the logic error occurred.