夜光带你走进C# 游戏开发等(一百一)擅长的领域

夜光序言:

 

 

人生不易,不要笑话别人。

家家都有难念的经,人人都有难唱的曲。

再风光的人,背后也有寒凉苦楚;

再幸福的人,内心也有无奈难处。

谁的人生都不易,笑人等于笑己,尊重别人就是尊重自己。

 

最穷无非讨饭,不死总会出头。

谁的人生十全十美,谁的生活没有薄凉,谁敢保证一直都人生得意。

金无足赤,人无完人。

 

 

 

 

 

 

 

 

 

正文:

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 案例1
{
    class Program
    {
        //值类型和引用类型~

        //struct 结构体,表示自定义的值类型
        struct Stu
        {
            // 如果我们想要访问这些参数,那么需要加上public
            public int no;
            public int age;
            public int chinese;
            public int math;
            public int english;

            //我们重写一下tostring方法
            public override string ToString()
            {
                return string.Format("no={0},age={1},chinese={2},math={3},english={4}"
                    ,no,age,chinese,math,english);
            }

        }

        static void Main(string[] args)
        {
            //夜光:我们先new出来下面这四个对象
            Stu s1 = new Stu() { no = 1, age = 11, chinese = 111, math = 1111, english = 11111 };
            Stu s2 = new Stu() { no = 2, age = 11, chinese = 111, math = 1111, english = 11111 };
            Stu s3 = new Stu() { no = 3, age = 11, chinese = 111, math = 1111, english = 11111 };
            Stu s4 = new Stu() { no = 4, age = 11, chinese = 111, math = 1111, english = 11111 };


            Console.WriteLine(sizeof(int));


            Console.ReadLine();
        }
    }
}

 

 

 

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值