• 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
Posts: 21963
36
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
Posts: 21963
36
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!
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!