• C#枚举的使用


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace Demo
    {
        enum orientation:byte
        {
            north = 1,
            south = 2,
            east = 3,
            west = 4
        }
        class Program
        {
            static void Main(string[] args)
            {
                byte directionByte;
                string directionString;
    
                orientation myDirection = orientation.north;
                Console.WriteLine("myDirection = {0}",myDirection);
    
                directionByte = Convert.ToByte(myDirection);
                directionString = Convert.ToString(myDirection);
    
                Console.WriteLine("directionByte = {0}", directionByte);
                Console.WriteLine("directionString = {0}", directionString);
                Console.ReadKey();
            }
        }
    }
    
    
  • 相关阅读:
    [日料探店] 食一料理
    工地英语
    C++20协程解糖
    C++20协程解糖
    C++20协程解糖
    单表操作
    数据库查询语句罗列
    数据库简易介绍
    mysql的常用操作
    css基础
  • 原文地址:https://www.cnblogs.com/jiqing9006/p/6728423.html
Copyright © 2020-2023  润新知