首页 > Windows开发 > 详细

13. C# --结构函数

时间:2015-05-14 12:16:36      阅读:158      评论:0      收藏:0      [点我收藏+]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
    class Program
{
        //定义结构函数
        struct customerName
{
            public string firstName, lastName;
            public string name()
{
                return firstName + " " + lastName;
}
}
        static void Main(string [] args)
{
            //调用结构函数
            customerName myCustomer;
            myCustomer.firstName = "John";
            myCustomer.lastName = "Franklin";
            Console.WriteLine( myCustomer.name ());
            Console.ReadLine();
}
}
}
 
 
 


本文出自 “Ricky's Blog” 博客,请务必保留此出处http://57388.blog.51cto.com/47388/1651183

13. C# --结构函数

原文:http://57388.blog.51cto.com/47388/1651183

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!