To err is human It is normal for programmers to make mistakes while learning c++ programming. Mistakes (or errors) are often caused by misconception in the programmers mind or by forgetting certain things. While syntax errors are easier to spot since the c++ compiler shows the related information but logical errors often remains unnoticed, and many a times the program works just as fine. It is not possible to completely eliminate errors by yourself but it is definitely possible to minimize them as a c++ programmer. Here I am listing 5 of the common mistakes (errors) that beginners commit (not sorted in any order). Mistake No. 1 Have a look at this C++ Program #include<iostream.h> void main(void) { int base,height,area; cout<<"Enter the base and height of the triangle:"; cin>>base>>height; area=0.5*base*height; cout<<endl<<"AREA:"<<area; } Here the variable area is such that sometimes its ...
A resource for learning PHP, HTML, CSS, JavaScript, C++, etc.