C
C#3y ago
surwren

Proper syntax (or usage) for unsigned int

How does one properly use an unsigned int in C#? I'm getting conflicting information from google about int32 being signed/unsigned or using input params like (unsigned int n) which don't seem to work.
3 Replies
Angius
Angius3y ago
You use it like any other type
MODiX
MODiX3y ago
Angius#1586
REPL Result: Success
uint x = 71653;
Console.WriteLine($"Your uint is {x}");
uint x = 71653;
Console.WriteLine($"Your uint is {x}");
Console Output
Your uint is 71653
Your uint is 71653
Compile: 618.472ms | Execution: 33.594ms | React with ❌ to remove this embed.
mtreit
mtreit3y ago
Sounds like you were trying to use the C syntax in C# Just use uint as @Angius demonstrated

Did you find this page helpful?