Posts

Showing posts from February, 2017

8 Common Programming Mistakes

  ==> Learning to program can be tough--just ask anyone who's done it! Fortunately, a lot of problems happen over and over again--I've put together 8 of the most common problems that you'll run into as a new programmer.   1. Undeclared Variables int main(){ cin>>x; cout< "Huh? Why do I get an error?" Your compiler doesn't know what x means. You need to declare it as a variable. int main(){ int x; cin>>x; cout< 2. Uninitialized variables int count; while(count<100 count="" cout="" pre=""> "Why doesn't my program enter the while loop?" In C++ variables are not initialized to zero. In the above snippet of code, count could be any value in the range of int. It might, for example, be 586, and in