An attempt to reference an uninitialized variable : Variable Definition : Language Basics C# Source Code


Custom Search

C# Source Code » Language Basics » Variable Definition »

 

An attempt to reference an uninitialized variable








    

/*
Mastering Visual C# .NET
by Jason Price, Mike Gunderloy

Publisher: Sybex;
ISBN: 0782129110
*/
/*
  Example2_4.cs shows an attempt to reference an
  uninitialized variable
*/

public class Example2_4
{

  public static void Main()
  {

    int myValue;
    System.Console.WriteLine(myValue);  // causes an error

  }

}


           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Language Basics
» Variable Definition