I have a header file "testcode.h"
#ifndef TESTCODE_H
and source file
#include "TestCode.h" int main(int argc, char* argv[]) { A* b = new B(); b->Foo(); b->mPublic = 0; b->mProtected = 0; b->mPrivate = 0; delete b; return 0; }
Here, I would like to know that when I call "b-> Foo", the function Foo of class B is called instead of class A. However, the function Foo of class B is not declared virtual. Can anyone clarify this?
jerry source share