Debugging

From programming_contest
Jump to navigation Jump to search

Eclipse

There are a couple things to know when doing these problems on eclipse:

  1. you can type or copy paste input into the console in eclipse. windo->show view->console. Just run your program, and then type the input exactly how the problem says
  2. the debugger. If you HAVEN'T used it yet, it's extremely powerful. Double click on the bar on the left hand side of your code to set a breakpoint somewhere near the start of your program. then click the little ant to the left of the run button. If you type in your input just like in point 1, eventually eclipse will ask you if you want to drop into the debugging perspective. say "yes" at this point, you can go through your program line by line, and see the values of all your variables in the upper right hand corner. It's exceptional. Use f6 to go line by line, and f5 to enter into functions