This isn't C, this is C++. A C equivalent would have been
You are correct in that (in C++),
are the same.
When you use a C-style cast (or a function-style cast that you used, which is the same thing) in a C++ program, you're asking the compiler to try all of the following, in this order, and use the first one that can be compiled:
2. static_cast (with some extensions, irrelevant here)
3. static_cast (with extensions) followed by const_cast
5. reinterpret_cast followed by const_cast
the biggest problem is if you're casting between pointers and the compiler picks reinterpret_cast where you intended a static_cast. Also, C++ programs are usually trying to be const-correct and any surprise const_cast is unwelcome as well.