Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Understanding reference in C#
Message
De
04/09/2010 05:00:49
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Understanding reference in C#
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Divers
Thread ID:
01480125
Message ID:
01480125
Vues:
106
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();
        }
    } 
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform