• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

K & B mock exam question typo

 
Francis Palattao
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This should be runtime error but in the mock exam it says the answer is Compilation error at line 6.

Is it a typo?
 
Jeff Bosch
Ranch Hand
Posts: 805
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's actually a runtime exception (not error) because the program tries to access an uninitialized array element. (You're also missing an opening brace at main().)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic