With the struct definition given below...
struct A {
virtual void hello() = 0;
};
Approach #1:
struct B : public A {
The 'virtualness' of a function is propagated implicitly, however at least one compiler I use will generate a warning if the virtual
keyword is not used explicitly, so you may want to use it if only to keep the compiler quiet.
From a purely stylistic point-of-view, including the virtual
keyword clearly 'advertises' the fact to the user that the function is virtual. This will be important to anyone further sub-classing B without having to check A's definition. For deep class hierarchies, this becomes especially important.