Declaring variables

I can not understand one thing

here we set Screen and then currentScreen

Okay We need first word Screen for some purpose. The questions are:

  1. Why do we need it if (as I suppose) the function was determined in row above (with enum)
  2. If we need Screen there, why we don’t need it below?

Thank you!

1 Like


What you are doing here is declaring a variable. In C#, in this example, the first word is the type, e.g. the data type of the variable, in this case its of type Screen.

The following word is the name of the variable, in this case currentScreen.

This would be the same for a string for exmaple;

string message;

message = "Hello World!";

Hope this helps.

1 Like

Sure, Rob! Thank you!

No worries, you’re more than welcome. :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms