委托是一种类,所以声明的时候尽量和其他类保持平级的位置 委托与所封装的方法必须“类型兼容”,也就是返回值的数据类型一致,参数列表个数和数据类型上一致 delegate double Calc(double x,double y)//委托封装方法的类型 double Add(double x,doub Read More
posted @ 2019-07-19 23:52 拎着红杯子的黄鸭子 Views(211) Comments(0) Diggs(0) Edit
using System;using System.Collections.Generic;using System.Linq;using System.Text; namespace DefineGraph{ class Graph { private const int Number = 10; Read More
posted @ 2019-07-19 14:08 拎着红杯子的黄鸭子 Views(564) Comments(0) Diggs(0) Edit
include typedef int (*Cal)(int a,int b);//定义一个函数指针,第一个int是指向函数的返回值的类型,后面括号里面的两个int是指指向函数的参数类型 int Add(int a ,int b) { int result=a+b; return result; } int Sub(int a ,int b) { int result=... Read More
posted @ 2019-07-19 13:46 拎着红杯子的黄鸭子 Views(160) Comments(0) Diggs(0) Edit