« AoE III | Main | Persistant Browser Based Games »
Attention to Detail while Programming in C++
By Ravenhawk | March 9, 2007
Now, obviously paying attention to the details while you’re programming is always important. I hate getting reminds of this however.
I’m currently working on a simple program using functions for my C++ class. It reads characters from a file, analyses them and then prints what type of character it was from a short list of categories.
I spent an hour trying to figure out what was wrong.
No matter what I put in it kept saying my character was a lowercase vowel (the first option).
I sprinkled cout’s all over the place trying to figure out where it was messing up between the functions.
Finally, I realized I had used = instead of == so I was setting my variable to 1 instead of comparing it.
I’ve done this in the past with an assignment, so hopefully this time lesson shall be learned and I shant do it again.
Until next time, Comrades.
Tags: C++, Programming, C
Topics: C++, Programming |









March 26th, 2007 at 10:51 am
heh heh,
That’s one that still gets me from time to time, even after having programmed in C/C++ for nearly 15 years. C++ is certainly a harsh mistress, but can be a lot of fun too.