Hello world in C++
#include<iostream> // Needed for input and output
using namespace std; // Standard library of C++
int main(){ //program entry point
cout << "Hello World"<<endl;
return 0;
}
Function declaration vs function definition
Scott Meyers, in Effective C++, provides a useful guideline:
if a class has any virtual function, it should have a virtual destructor, and that classes not designed to be base classes or not designed to be used polymorphically should not declare virtual destructors.
There are other forumlas to compute $\pi$, such as $\pi = 4 \times \sum_{n=0}^{\infty} \frac{(-1)^n}{2n + 1}$ ↩