```
#include "stdafx.h"
#include <iostream>
using namespace std;
class myclass {
public:
    int a;
    myclass() : a(-1){};
 };
class derivedclass : public myclass {
     public: 
     int b;
    derivedclass() : b(-2) {};
  };

int main()
{
myclass* p= new myclass;
//  derivedclass* pd = dynamic_cast<derivedclass*>(p);
derivedclass* pd = static_cast<derivedclass*>(p);
cout << pd->b << endl;

return 0;
}

```

I have two questions. 

1. `dynamic_cast` is not working. So need to add a virtual function in
`myclass`?
2. why `pd->b` is not `-2` as is initialized in the
constructor?