Horje
implicit vs explicit cast c# Code Example
implicit vs explicit cast c#
// Implicit (converting from a smaller type to a larger type)
int anInt = 12;
float aFloat = anInt;

Console.WriteLine($"anInt: {anInt}"); // anInt: 12
Console.WriteLine($"aFloat: {aFloat}"); // aFloat: 12

// Explicit (converting from a larger type to a smaller type)
float aFloat = 12.945f;
int anInt = (int) aFloat;

Console.WriteLine($"aFloat: {aFloat}"); // aFloat: 12.945
Console.WriteLine($"anInt: {anInt}"); // anInt: 12




Csharp

Related
how to twist a image in the code behind C# Code Example how to twist a image in the code behind C# Code Example
epplus how to align text to right Code Example epplus how to align text to right Code Example
Options Pattern how to use Code Example Options Pattern how to use Code Example
ternary operator c# Code Example ternary operator c# Code Example
unity debug log gameobject Code Example unity debug log gameobject Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
13