using System;
public class myclass
{
 public static void method(ref int i)
{
 i=9;
}
public static void Main()
{
 int p=0;
 method(ref p);
 Console.WriteLine(p);
 Console.ReadKey();
}
}
我是一个初学者
这个程序编译成功,但有一个警告“加载属性‘Nootnamespace’失败,根命名空间的字符串必须是有用的标识符!”
 请各位大侠帮忙指点一下!
                                                  在线等待............

解决方案 »

  1.   

    using System;namespace MyNameSpace
    {
        public class MyClass
        {
            //临时方法
            public static void Method(ref int i)
            {
                i = 9;
            }        public static void Main()
            {
                int i = 0;
                Method(ref i);            Console.WriteLine(i);
                Console.ReadKey();
            }
        }
    }
      

  2.   

    using System;namespace NameSpaceName //加你的命名空间的名称
    {
        public class MyClass
        {