Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unreachible code detected

 
Branden Bobo
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody tell me why the compiler tells me unreachible code detected in line: 12

I'm guessing it's detecting the inner loop as an infinite loop, but I can't figure out the logical error?



 
Paul Clapham
Sheriff
Pie
Posts: 20945
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I read that for-loop right, then it doesn't have a termination condition. So yes, I suppose the compiler might well observe that and classify it as an infinite loop.
 
Branden Bobo
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I feel stupid, I've been staring at this method for 30min stumped by somethiing I should have know(seen).
 
Paul Clapham
Sheriff
Pie
Posts: 20945
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup, I too have found that there's nothing like asking somebody else a question when you're suffering from that kind of blindness. That's what the Ranch is here for!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic