Pages

Sunday, July 17, 2011

What is wrong with this switch statement? (C++)?

Can't see anything wrong with the switch statement, but you would need to dereference the pointer in the while loop for it to find the end of the string correctly otherwise it'll just keep going (i.e while(ch_ptr != '\0') should be while(*ch_ptr != '\0') ).

No comments:

Post a Comment

Copyright © 2011-2012 MaxCTR Blogger Template Converted by Xiontechinfo.Com and BlogisBlogging.Com