In the above code , Base class becomes abstract class when = 0 (i.e) Base::foo() a pure virtual function (denoted by "= 0").
*
A class is abstract if it contains at
least one pure virtual function.
No instances of an abstract class may be created, nor may an abstract class be used as a function argument or return type.
Abstract class pointers and references are always legal.
Typically an abstract class is used just as in the example above, to serve as a base and allow for manipulation via pointers or references that actually refer to instances of derived types.
The second method of creating an empty function, does not do that.
Ref: http://www.glenmccl.com/tip_033.htm