定义结构体
为了定义一个结构体,您必须使用 struct 语句。struct 语句为程序定义了一个带有多个成员的新的数据类型。
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace day01
{
struct Books
{
public string title;
public string author;
public string subject;
public int book_id;
};
class Program
{
static void Main(string[] args)
{
Books Book1;
Book1.title = "书名:《西游记》";
Book1.author = "作者:施耐庵";
Book1.subject = "种类:小说";
Book1.book_id = 72;
string[] mystr = new string[] { Book1.title,
Book1.author,
Book1.subject , Convert.ToString(Book1.book_id) };
string joinstr =String.Join