What's new
Carbonite

South Africa's Top Online Tech Classifieds!
Register a free account today to become a member! (No Under 18's)
Home of C.U.D.

looking for C# Mentor

Status
Not open for further replies

Nekuro

Epic Member
Rating - 100%
61   0   0
Joined
May 18, 2018
Messages
478
Reaction score
155
Points
3,135
Location
Cape Town
Hi, Like post says, I am busy learning C# and just looking for someone i can chat to if some stuff dont make sense to me.

Busy with a C# Udemy course aswell as with a couple youtube series, Still early days but really keen to make this work and to start learning C#.

The thing im struggling to understand at the moment is "Implicit and Excplicit Conversions", To me it looks like it does pretty much the same thing, one allows data loss but the other doesnt?
Is there any decent examples of a scenario where implicit would be ued over explicit?

Thanks in advance to whoever is willing to help a nub like me understand computer wizardry
 
Implicit: Assign int variable value into a double, 1 -> 1.0

Explicit: use a ToString() function to convert char/int/double/whatever, into a String, 'c' -> "c" or 1 -> "1".

Try not to use implicit, tends to get runtime errors because of unforeseen use cases. Especially in non-type safe languages like php (yes your question is on c#, but the concept is fairly general on all languages).
 
Been a few years since I did C# Dev, but this seems like a pretty nice blog post with the type of example I was looking for.

 
In addition, ChatGPT is a great tutor that can help clarify issues you may face
 
Status
Not open for further replies

Users who are viewing this thread

Back
Top Bottom