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: 
No, you only need to `delete` that which has been allocated using `new`. Simple value types like `int`s never need to be deleted.

If your class *did* include data dynamically allocated using `new` either by the constructor or later by some other method then the destructor should typically de-allocate all of it, regardless of wether the data is public or private.

I might add that having publically visible dynamically allocated pointer members might not be the best design, though.
`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).