use of structures

Topic description  

Use of structures. (console application)

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

Use of namespace structure
{
    public struct Clerk
    {
        public string name;
        public int age;
        public string department;
        public char gender;
    }
    class Program
    {
        static void Main(string[] args)
        {
            Clerk zs = new Clerk();
            zs.name = "Zhang San";
            zs.age = 25;
            zs.department = "Ministry of Manpower";
            zs.gender='male';
            Console.WriteLine("My name is {0}, my age is {1}, I work in the {2} department, my gender is {3}",zs.name,zs.age,zs.department,zs.gender );
        }
    }
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325956067&siteId=291194637