Talking about the Microsoft C # compiler and the Mono C # compiler

Source: Internet
Author: User
Tags microsoft c

I wrote an essay on April 19, 2009, "Timus 1037." Memory Management, the following structure (Structs) is used to represent a "memory block":

struct Block
{
 public int Id { get; private set; }
 public int Time { get; set; }
 public Block(int id, int time) : this() { Id = id; Time = time; }
}

In this structure, the ID represents the number of "memory block", and time represents the "memory block" expiration, which is an automatically implemented property (Auto-implemented properties).

The following is our protagonist Block.cs source program files:

using System;

namespace Skyiv.Ben.Test
{
 struct Block
 {
  public int Id { get; private set; }
  public int Time { get; set; }
  public Block(int id) : this() { Id = id; }
 }
 
 sealed class Test
 {
  static void Main()
  {
   Console.WriteLine(new Block(37).Time);
  }
 }
}

We will compile this C # source file separately under Windows and Linux operating systems.

The version of the Windows operating system looks like this:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.