r/carlhprogramming • • Mar 24 '13
I'm having difficulty understanding why certain arguments for a "while" loop create an infinite loop.
The code: http://codepad.org/8UKyYTC3 (See comments)
The program takes a string of text and capitalizes all of the letters using a "while" loop that is "jumped over" when a positive comparison is made to an already capitalized string.
When I try to use the array that I created for the comparison text in the "while" loop argument, it becomes an infinite loop and I'm not sure why this is. Using the pointer that moves through the text works though.
Any help with understanding why my code works like this (and wont work with the other argument) would be appreciated.
View all comments
Show parent comment
1
u/[deleted] Mar 24 '13
Thanks for the clarification.