: : No, C++ isn't Java

:
: then why does exist try catch blocks?
: please, can you show me a good way to use exceptions?
: using classes of exception or not
:
They exist for error handling of your own program. In C, the traditional way to do error handling in function is like this:
ErrorCode func ()
{
...
return someErrorCode;
}
The problem with the above is that you'll have to return values calculated in the function through pointers. If the error code is passed with an exception instead, the function can use the return value for actual values.
And imagine an operator overloading:
SomeClass operator = (SomeClass& obj);
All the parameters and the return value must be in a fixed pattern. Without exception handling, you wouldn't be able to handle errors from that function.