Yes, they are the same. Any function overriding a virtual function in the base class is implicitly declared virtual.
From the last working draft of the c++14 standard:
10.3 Virtual functions [class.virtual]
If a virtual member function vf is declared in a class Base and in a class Derived, derived directly or indirectly from Base, a member function vf with the same name, parameter-type-list (8.3.5), cv-qualification, and ref- § 10.3 249 c ISO/IEC N4296 qualifier (or absence of same) as Base::vf is declared, then Derived::vf is also virtual (whether or not it is so declared) and it overrides(111) Base::vf.
Emphasis mine
As @Mats and @ixSci pointed out, it is good practice since c++11, to use the keyword override
to ensure that you are actually overriding a virtual function and not acidentally overloading a function or overriding a non-virtual function.
Personally, my preferred style is this, but it is up to debate whether the virtual keyword in B adds any value or is even harming readability:
class A{
public:
virtual void fun(){ }
};
class B :public A{
public:
virtual void fun() override {}
};