Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Understanding reference in C#
Message
From
04/09/2010 05:00:49
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Understanding reference in C#
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Miscellaneous
Thread ID:
01480125
Message ID:
01480125
Views:
107
Hi,
I found a code snippet and have questions about it:
1. when I try to run it gives me "the 'MyClasss' does not exist in the current context" error.
2. why can "s" be referenced in line "MyClassp = s;" as "s" and what is passed by it to MyClassp?
thanks
using System;
using System.Collections.Generic;
using System.Text;

    class MyClass
    {
        public int x;
    }

    class Program
    {
        static public void Main()
        {
            MyClasss = new MyClass();
            s.x = 10;

            MyClassp = s;
            p.x = 14;

            Console.WriteLine(s.x);
            Console.ReadLine();
        }
    } 
Next
Reply
Map
View

Click here to load this message in the networking platform