Here is the collection question/answer that I collected from this thread. I hope this is helpful.
History SummaryComputer language was born since the first electronic computers were built. It was represented by long strings of 0 and 1. Because it was too difficult for normal people to understand and wasted too much time to create a simple program, Programming languages were invented to made thing easier and easier after time by time. C was created by Dennis Ritchie in 1971 and Bjarne Stroustrup developed C++ in 1980s based on C language.
What is compiler and IDE?Compiler is a program that translates a computer language into object code which can then be assembled into machine language. This is necessary for programming in all high level languages (like C/C++ and Pascal) which are not interpreted (like BASIC).
IDE is an Integrated Development Environment. An IDE consists of all the basic tools a programmer needs to create a program. Typically, an IDE consists of a text editor, a compiler, a debugger, and other necessary tools.
[taken from GameDev.net Dictionary]What the difference between <iostream> and <iostream.h>?<iostream.h> is out of date and non-standard C++.
What the difference between "void main()" and "int main()"?The C++ standard mandates that main() return an int. Anything else is incorrect. void main() is explicitely marked as being incorrect. That value is passed back to the program that executed your program (e.g. Windows GUI or command line) and can be used in shell scripts (or batch files) to determine whether the program succeeded or not.
You do not actually have to explicitely return a value (though you still must define main() as returning an int), since "falling off" the end of main() is equivalent to returning 0.
Some compilers that were written before C++ got standardized accepted void main(). Outdated tutorials, or tutorials written by people with incompled or outdated knowledge may use void main() even though it is wrong. Same with books.
[Post by Fruny]What the difference between "std::endl" and "\n"?Use "std::endl" instead of "\n". std::endl does more than kick to the next line; It flushes the buffer to the screen. This isn't so important with console output, but makes a difference for file output. Also, I believe some operating systems may require more than just an endline (such as a carriage return), so it's best to keep your code platform independent.
[Post by Sr_Guapo]Why I got error(s) when I compiled my program?error C2065: 'endl' : undeclared identifiererror C2065: 'cout' : undeclared identifier
If you got errors like above. Please ensure you use "std::cout" and "std::endl" instead of "cout" and "endl". For example:
#include <iostream>int main(){ std::cout << "Hello World!" << std::endl;}
If you don't like std:: there are other 2 ways to omit it.
First Way
#include <iostream>using std::cout;using std::endl;int main(){ cout << "Hello World!" << endl;}
Second Way
#include <iostream>using namespace std;int main(){ cout << "Hello World!" << endl;}