C#C
C#3y ago
__dil__

❔ Reading from stdin

So, I'm trying to work with basic IO stuff. I have this snippet:
string line;
while ((line = Console.ReadLine()) != null) {
  // Stuff...
}

I get a warning about assigning a nullable value to a non-nullable variable. I understand what the warning is saying, but I'm not sure how I'm supposed to do any better than this considering I am already checking for null values. Any recommendations?
Was this page helpful?