C
C#

help

❔ force a ushort value?

PPatrickG2/2/2023
if i type for example var num = 25L; i am forcing a long value (int64) how can i force a ushort in the same way?
BBuddy2/2/2023
By defining it explicity as ushort
AAngius2/2/2023
Can't find anything in the docs, oddly enough, but found this: https://www.c-sharpcorner.com/article/data-type-suffixes-in-c-sharp/ Would us work...?
MMODiX2/2/2023
thinker227#5176
REPL Result: Failure
1us
1us
Exception: CompilationErrorException
- ; expected
- The name 's' does not exist in the current context
- ; expected
- The name 's' does not exist in the current context
Compile: 323.907ms | Execution: 0.000ms | React with ❌ to remove this embed.
TThinker2/2/2023
huh, thought that worked
MMODiX2/2/2023
Angius#1586
REPL Result: Success
1ul
1ul
Result: ulong
1
1
Compile: 288.057ms | Execution: 22.866ms | React with ❌ to remove this embed.
AAngius2/2/2023
Works for ulongs Not for ushorts tho
TThinker2/2/2023
Smadge
PPatrickG2/2/2023
oh well i endedup doing (ushort)25
AAngius2/2/2023
Or just use ushort instead of var...?
Eero2/2/2023
short and byte don't have suffixes they used to, actually 1y for byte (???????????) and 1s for short
AAccord2/3/2023
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.

Looking for more? Join the community!

Want results from more Discord servers?
Add your server
Recommended Posts
❔ Doing post method with entity frameworki'm making a simple API to practice with entity framework but when i try to make a post to a table w❔ I can't reference a class library please helpI can't reference a class library i t says compilation error❔ ASP.NET REMOTE DEVELOPMENTHey does anyone know if I would need nginx for remote development on a ubuntu server from my windowException/NULL/Error handling advice.DeserializeAsync clearly returns a nullable generic object. From the picture we can clearly see that❔ ASP.NET Core web app vs ASP.net web application(.NET Framework)Hi, Ive been working with c# for a while now and would like to make a webapp but I dont know where t✅ IGNORE PEOPLEmy place for testing commands❔ Game Hubhi, how can i program my own game hub, like battle.net where i can download and start my own games ?❔ ✅ beginner class and propertiesi am doing basic program abt class and getting information from input but on the weight section whe❔ Best practice to retrieve MySQL columnsHello wonderful people! Can you please help me understanding what would be the best practice to ret❔ Auto Slide Showhere my code✅ materialDesign:Cardfor some reason it says that closing matrialcard doesent exist and it shows an error❔ Why does this code give the CS8604 warning?I'm confused why the below code gives the CS8604 warning. As far as I am concerned, I am null checki✅ Having trouble adding a picture to my code.what should the path look like?❔ Producer Consumer ISourceBlock<T>, periodically flushing consumed dataHi, I've the following scenario: I've a camera continuously acquiring frames and a c# app receiving ❔ Load async data and display it (WindowsAppSDK / WinUI3)I am currently developing my first windows app with C#, Windows App SDK and WinUI3. I want to do som❔ Best Approach to Implement Authentication and Authorization in Microservices with ASP.NET CoreHi friends, I'm looking for experience share. I have Microservices architecture project, that uses ❔ Performance of many small requests vs less but bigger requestsI have 2 projects: an API hosted on aws and a desktop application. Currently, I'm fetching around 4k✅ Image from dataurlI have dataurl with image and i need to get it to some reasonable image object in c#, so i can resiz✅ why does the test case fail?This is from a longest palindrome puzzle on LeetCode https://leetcode.com/problems/longest-palindrom❔ MongoDB Update nested elementsMongoDB question, I'm trying to add a property to all of my existing documents. The thing is, my doc