❔ Could someone please clarify the difference between Explicit Casting and Converting?

From what I've read, they seem to serve the same function, taking a value of one type and changing it to another type, and the only difference is that explicit casting has the potential to lose accuracy. Examples shown in attached pics. So in what scenarios would you want to use cast / convert over the other? Thanks
5 Replies
JakenVeina
JakenVeina2y ago
can't really do a better explanation than this
JakenVeina
JakenVeina2y ago
Stack Overflow
Difference between casting and using the Convert.To() method
I have a function that casts a double on string values. string variable = "5.00"; double varDouble = (double)variable; A code change was checked in and the project builds with the error: System.
JakenVeina
JakenVeina2y ago
feel free to skip to the "Conclusions" section
TheIronDisciple
TheIronDiscipleOP2y ago
Ok, thank you for that I will check it out
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server