Question: I am learning C++ and I am not clear about the destructor of a class. For example:

```
class A:
{
  public:
    int valueA;
  private:
    int valueB;
};

A:~A()
{
  delete valueA;
  delete valueB;
}

```

So, basically is it right to delete every declarations in the public and private?

Answer: 
`delete` is only intended for pointers. In the general sense, yes, you should delete all public and private variables for which memory you own (you've reserved inside your class and it's your responsibility to delete).
No，just delete some pointers that are constructed in your class.