[求助]C#中结构的定义,俺老是搞不明白!
using System;namespace ConsoleApplication2
{
class Class1
{
static void Main(string[] args)
{
struct customerName
{public string firstName,lastName;}
customerName myName;
myName.firstName="Jhon";
myName.lastName="smith";
Console.WriteLine("{0}{1}",myName.firstName,myName.lastName);
}
}
}
这段代码错在哪啊?为什么我把customerName的定义放在Main()函数外面就能通过编译。放在Main()函数内部却不行?请指教!