Public bug reported:

I new in mono and C#. I try to use sample from book with struct ussage
and get error:

using System;
namespace Proj
{
        public struct Point
        {
                private int _x;
                private int _y;
                public int X
                {
                        get {return _x;}
                        set {_x = value;}
                }
                public int Y
                {
                        get{return _y;}
                        set{ _y = value;}
                }
        }

        public class Program
        {
                public static void Main(string[] args)
                {
                        Point p;
                        Console.WriteLine(p.X);
                }
        }

}

$ mono-csc Program.cs
Program.cs(32,43): error CS0165: Use of unassigned local variable `p'
Compilation failed: 1 error(s), 0 warnings

** Affects: mono (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/877312

Title:
  struct usage problem: Use of unassigned local variable

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mono/+bug/877312/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to