I have been using PHP (and a few other languages) for close to 7 years. I have a pretty deep understanding of casting, and how it works in those languages...all though to be honest, I rarely if ever need it.
That makes me wonder about C++. I see there are two ways to perform casting..the C style short casting..and the C++ functions to perform casting. After reading 2-3 books and doing some searches it seems the short way is generally discourages.
So focusing on the C++ style casts..I was able to narrow it down to 4 core things I needed to look at for casting..
Dynamic, Static, Reinterpet, and constant.
After all of the reading I have done in books, and via:
http://www.cplusplus.com/doc/tutorial/typecasting/
the casting is only making a little sense, if any.
Basically each function has a specific purpose that it's used for...let's start with the first...
Dynamic: I have NO idea what this does..I can't understand any of this one.
Static:
well..none of them make sense..all that I have read in that tutorial and in the books makes absolutely no sense. My understanding of casting in related to programming should simply mean..change a variable from one type of data to another.....
Meaning...convert an int to a string..convert a string to an int..convert a constant into a int.....In my thinking..there is no way you can convert an object to a string or an object to an int...these 4 different uses for doing casting is not making any sense...I was expecting something like:
function to convert from string to int and vice versa as well as some others for perhaps other data types.
Any one have an english explanation of this..I am a good programmer with those other languages..but in C++ I haven't even gotten to classes a lot (not as much as I have in PHP, and I don't even know really what a pointer is..or how (in theory) it works.