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 ...
随机推荐
- 【solr基础教程之九】client
一.Java Script 1.因为Solr本身能够返回Json格式的结果,而JavaScript对于处理Json数据具有天然的优势,因此使用JavaScript实现Solrclient是一个非常好的 ...
- 初学ios遇到问题记录01
刚刚接触IOS,花了一段时间看我基础部分的OC后 就想试着弄个小程序,于是看到 http://www.cnblogs.com/LooDo/p/3907064.html博文中的小程序,博主分析的很详细, ...
- DM8168 DVRRDK软件框架研究
转载注明:http://blog.csdn.net/guo8113/article/details/41120491 Netra(DM8168)处理器是个多核处理器,每一个核之间相互独立却又相互关联, ...
- Android 软件开发之 PreferenceActivity 中的组件
1.PreferenceActivity 介绍 PreferenceActivity 继承ListActivity 它是以一个列表的形式在展现内容,它最主要的特点是添加Preference可以让控件的 ...
- android 模拟器定在了任务栏出不来了
系统 任务栏上显示了正在运行的模拟器,但是点击它,始终看不到模拟器显示出来.用Alt + Tab 切换也不行 按照网上的说法 1.重新建一个模拟器,名字变一下 2.找到模拟器对应的配置文件,路径不管, ...
- eclipse 中修改 M2_REPO的值--转载
从eclipse中增加了maven2的插件之后,maven默认的本地库的路径是${user}/.m2/repository/下,一般windows用户的操作系统都安装在C盘,所以这个目录 下的jar包 ...
- Io_Language
Object ancestor := method ( prototype := self proto if (prototype != Obejct, writeln ("Slots of ...
- C#数据类型中的decimal精度比double更高
decimal 128bit大小 有效数字:28~29,虽然decimal类型有比浮点类型更高的精度,但它的范围更小.故double转decimal有可能发生溢出错误,此外,decimal的计算速度稍 ...
- Java基础知识强化之IO流笔记39:字符流缓冲流之复制文本文件案例01
1. 字符流缓冲流之复制文本文件案例 需求:把当前项目目录下的a.txt内容复制到当前项目目录下的b.txt中 数据源: a.txt -- 读取数据 -- 字符转换流 -- InputStreamRe ...
- 九度 1371 最小的K个数
题目描述:输入n个整数,找出其中最小的K个数.例如输入4,5,1,6,2,7,3,8这8个数字,则最小的4个数字是1,2,3,4,. 输入: 每个测试案例包括2行:第一行为2个整数n,k(1<= ...