摘要:
/* Example7_6.cs illustrates some of the System.Object class methods*/
using System;
class Example7_6{
class Program
{
static void Main(string[] args)
{
MyStruct st = new MyStruct();
st.X = 50;
Console.WriteLine(st.X);
Console.ReadLine();
} 阅读全文
摘要:
/*
Example6_3.cs illustrates the use of readonly fields
*/
// declare the Car class
public class Car
{
// declare a readonly field
public readonly string make;
// declare a static readonly field
public static readonly int wheels = 4;
// define a constructor
public Car(string make)
{
System.Console.WriteLine("Creating a Car object");
this.make = make;
}
} 阅读全文
摘要:
/*
Example4_17.cs illustrates the use of the
#undef, #elif, and #else preprocessor directives
*/
#define DEBUG
#undef DEBUG
#define PRODUCTION 阅读全文