@qtpan,
if you really want to be a good at programming use the right code,.. |
I recommend you do the same.
Also, he
does want strcmp() not strlen().
What Disch said was correct.
@jaymilum,
First of all, I'm glad you're using code tags, but please indent your code to make it easy to read.
Secondly, you must be using system("pause"). This is bad. Please use getchar() instead.
Thirdly, are you initializing
char c
? If so, you should be initializing it with a 'y' or a 'Y'. If not, you should be initializing it with a 'y' or a 'Y'. If you don't initialize it correctly, the loop falls through.
Fourth, the reason that the "Would you like another comparison? press y to continue:" falls through is because of newlines left on stdin by scanf. Use getchar() after each scanf().
Finally, you do
not need scanf() and the overhead of checking the format and what-not will make your code slower. Use getchar() instead of scanf().
Read:
http://cplusplus.com/forum/beginner/22128/#msg116074
http://cplusplus.com/forum/articles/11153/