static_cast is used to convert between enum and integer.
the same can be done using c-type casting.
then why static_cast is used ??
a c-style cast can do a lot of things. By using a static_cast you are
expressing your intent more clearly. The "new" style casts are easier
to find with grep and standout in the code. Casts should be few and
far between. They can be the source of subtle (and not so subtle)
bugs. The ability to easily find all the casts in your source code can
be helpful.
char s;
strcpy ((char*)s, "hello");