Function Pointer in Delpni
program Project1; {$APPTYPE CONSOLE}
{$R *.res} uses
System.SysUtils; type
TVoice = function(): String; function WithAmericanDoll(): String;
begin
Result := 'Oh yes, Oh, F M.';
end; function WithJapanDoll(): String;
begin
Result := 'ah, a~ah, eku..eku..';
end; function MkLove(voice: TVoice): String;
begin
Result := voice();
end;
var
temp: String;
begin
try
{ TODO -oUser -cConsole Main : Insert code here }
Writeln('1.AmericanDoll.');
Writeln(' ' + MkLove(WithAmericanDoll));
Writeln('1.JapanDoll.');
Writeln(' ' + MkLove(WithJapanDoll));
Readln;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end; end.
Function Pointer in Delpni的更多相关文章
- C 函数与指针(function & pointer)
C 函数与指针(function & pointer) /* * function.c * 函数在C中的使用 * */ #include <stdio.h> int noswap( ...
- 类非静态成员的函数指针 的使用 Function pointer of a non-static member function of a class
you can get the pointer of the method, but it has to be called with an object typedef void (T::*Meth ...
- tips~function pointer
An simple example: #include<stdio.h> int plus(int a,int b) { return a+b; } int main() { int (* ...
- 指向函数的指针 ------ 函数指针(function pointer)
函数指针: 指向函数的指针, 首先是一个指针, 这个指针指向一个函数. 函数具有可赋值给指针的物理内存地址,一个函数的函数名就是一个指针,它指向函数的代码.一个函数的地址是该函数的进入点,也是调用函数 ...
- 44(function pointer 2)
#include<iostream> using namespace std; class A { public: int x; int sayhello() { cout<< ...
- 43(function pointer 1)
#include<iostream> using namespace std; typedef int A; typedef void (*PF)(); typedef int (*P_A ...
- C++ function pointer and type cast
http://www.cprogramming.com/tutorial/function-pointers.html http://www.cplusplus.com/doc/tutorial/ty ...
- 指针函数(Pointer Function)和函数指针(Pointer to Function或Function Pointer)
一.指针函数 1.解释:指针函数很好理解:简单来说,就是一个返回指针的函数,本质是一个函数.如: int fun(int x,int y); //这是一个普通函数的声明,返回值是一个int类型, ...
- Using a Comparison Function for the Key Type
(这是C++系列随笔的第二篇,这一系列是我练习C++而查的资料) C++ Primer 5th. Ed. pp. 425 ---------------------- Using a Comparis ...
随机推荐
- 机房收费系统(VB.NET)——存储过程实战
最初接触存储过程是在耿建玲老师的视频里,当初仅仅是草草过了一遍.仅仅是有了个印象.知道了这个名词:大二时也有SqlServer数据库这门课,只是老师没讲,自己也没看:真正对存储过程的了解来自于自学考试 ...
- Android(java)学习笔记152:Android运行时异常“Binary XML file line # : Error inflating class”
在原生Android下编译APK,编译没有问题,但是在运行的时候经常出现如标题所描述的异常:"Binary XML file line # : Error inflating class&q ...
- css制作小三角
视觉稿中经常有些小三角,如下图.每次用图片做太不方便了,我们看看用css实现的效果(支持ie6,7哦) <style> /*border实现三角*/ /*箭头向上*/ .arrow-top ...
- 开源安全测试 - BackTrack的应用
开源安全测试 - BackTrack的应用: http://gdtesting.com/product.php?id=99
- c语言冒泡排序,指针,数组
冒泡排序算法的运作如下: 比较相邻的元素.如果第一个比第二个大,就交换他们两个. 对每一对相邻元素作同样的工作,从开始第一对到结尾的最后一对.在这一点,最后的元素应该会是最大的数. 针对所有的元素重复 ...
- 制作win7+ubuntu +winPE+CDlinux多系统启动U盘
制作前期准备工作 1.需要软件 grub4dos(http://sourceforge.net/projects/grub4dos/files/) UltraISO(http://cn.ezbsyst ...
- day0
/* 考前最后一天了 由于下午赶路 就放到上午发了 早晨浏览博客 上午浏览博客 感谢学弟为我写的博客233 很开心认识你们这一群人 嗯 最后一天了 就要说再见了 大家加油吧 ^ ^ */
- JavaScript入门(5)
一.什么是数组? 数组是一个值的集合,每一个值都有一个索引号,从0开始,每个索引都有一个相应的值,根据需要添加更多数值. 好比一个团,团里有很多人.如下使用数组存储5个学生成绩: 二.如何创建数组 使 ...
- VS2010数据库连接问题
我用SQL server 2008写了一个小表格,运行VS的前选择了 工具-连接数据库,然后选择了那个表格的名称.运行后出现如下错误提示,请问是哪里出了问题呢? 数据库连接版本有问题.在VS中把信用数 ...
- (转)Ilist 和list的区别归纳总结
常见问题: Ilist <> 本身只是一个泛型接口, 既然是接口当然不能实例化,只能用如下方法 IList <Class1> IList11 =new List <Cla ...