C
C#

help

❔ help with code

SSmolLime1172/11/2023
what is the problem in this code?
Pphaseshift2/11/2023
Don't know, what is the problem?
SSmolLime1172/11/2023
i dont understand why it is highlighting Console.ReadLine(); yellow
TThinker2/11/2023
the only thing there is a warning it's not an error
Pphaseshift2/11/2023
It tells you when you mouse over it
SSmolLime1172/11/2023
yeah but even when there is nothing there is says there is a problem
TThinker2/11/2023
that's just vscode being vscode restart vsc and it'll probably be fixed
SSmolLime1172/11/2023
oh
TThinker2/11/2023
but anyway, the warning itself says that the result of Console.ReadLine() may be null You can solve this either by doing Console.ReadLine() ?? "" or doing Console.ReadLine()! The first of which is kinda the most preferable
SSmolLime1172/11/2023
oh ok that makes sense thanks
TThinker2/11/2023
a ?? b essentially means "if a is not null then return a from the expression, otherwise return b"
AAccord2/12/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
❔ What is the difference between these two pieces of code?```cs static PlayerHandler HPlayer => Program.HPlayer; ``` ```cs static PlayerHandler HPlayer = Prog❔ Questions about popupsI'm newer to the UI via xaml + c# space, so I have a question about creation like shown here in the ❔ Microservice: User information being split up in IdentityProvider and ServiceProviderMicroservice: User information being split up in IdentityProvider and ServiceProvider This will req❔ Optimization thoughts on a loop.Looking for potential ways to speed up this operation. Any thoughts? The entries of each HashSet wil❔ How to shorten switch statement```cs public void SwitchAvailability(string koalaName) { switch(koalaNam❔ BinaryFormatter does not serialize/deserialize the Tags of listview itemsso i have a listview that i want to serialize and then desirialize. I store some values in the tags ❔ ✅ Using generics that implement IEqualityOperators results in ambiguous call to the == operatorIf I have some `T: IEqualityOperators<T, T, bool>` and use a LINQ query such as `myTs.FirstOrDefault✅ Simple questionI have a code which ```cs if ("any" is "item1" or "item2" or "any") { Console.WriteLine("okay");Hi im not sure that my code is working as it should(class in c sharp)providing code here👇(When i add +1 or +10 to the GetX or GetY isn't it supossed to change?)❔ VISUAL STUDIO C# DATABASE AND LISTBOXI am currently working on my assignment and am stuck on this issue Where I have a Database to fetch❔ Sprites are invisible in build?i can see everything in the engine (unity) and ive gone over a bunch of things even checking my came❔ Hi,my flappy bird game script isnt workingThe script in making is to show that the score counter incrreases when the gamobject(bird) collides Hi i need some help with classes, im pretty new to this and i have an error with my code.help would be appreciated(in csharp)❔ Optional does not work with C# protobufsI have a proto buf with the timestamp field being marked as optional, but it doesn't seem to do anyt❔ ✅The largest inscribed circle inside concave (non-convex) polygon 2DHey, I want to make an algorithm that will return the largest inscribed circle in any 2D polygon (or❔ SqlLite Datareader to C# ModelWhat is the best way to convert the datareader object to the c# model class?❔ Program does not contain static 'Main'```csharp using System.Collections.Specialized; using System.Security.Cryptography.X509Certificates;❔ Real-Time MSTest ReporterI'm wanting to write a custom, real-time reporter for MSTest. Is there a formal API for hooking into❔ If my microservices are bunch of azure function should I use rabbitmq ?Hi I started to hear about rabbitmq more frequently but the way I communicate with services Azure Fu✅ Tuples in classes```csharp using System.Collections.Specialized; class Program { static void Main(string[] args)