The typecasting is the feature which makes C++ more type-safe, robust & may convince you to use it over C. But this is also a more underrated t...
For further actions, you may consider blocking this person and/or reporting abuse
Most of explanations sound not very clear to me. For instance, regarding constness. It would be great to see more comments about given examples touching some basics for the people who, for instance, are trying to master C++ after C#, etc. I think it would be more efficient than addressing such people to other references, books...
isn't it subjective matter?
Every matter is subjective ;) We all express our thoughts and wishes.
Erm,
(float)10/2
is not 2.5 coliru.stacked-crooked.com/a/77b57...Also, "you can also write
(float)10
likefloat(10)
isn't correct and makes it seem as if they're interchangable. I know some later text mentions the danger (eg(float) "danger"s
) but by then the damage might be doneYes...! You are correct. But that is what my point is.
You shouldn't use C-style cast.
Use
new
instead ofmalloc
anddelete
instead offree
.There is malloc and free in C++ i.e.
std::malloc
andstd::free
respectively.Hey man!
Thanks for pointing it out.
You should update the following as well.
done
Finally! This is exactly the article I have been looking for in the past year. Thank you for this!
Thanks, Dood...