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 ...
随机推荐
- UEFI引导修复教程和工具
参考 http://bbs.wuyou.com/forum.php?mod=viewthread&tid=323759 1. MBR分区表:Master Boot Record,即硬盘主引导记 ...
- localtunnel.me 原理流程浅析
本文採用知识共享署名-同样方式共享 4.0 国际许可协议进行许可. 近期公司的项目须要一个后台server,要求能将内网的WEBserver暴露在外网上.于是.就在网上到处搜开源项目.找到两个口碑 ...
- windows 7 64位 安装oracle 11g R2
1.下载Oracle 11g R2 for Windows的版本 下载地址: http://www.oracle.com/technetwork/database/enterprise-edition ...
- iphone4s 关于大于400M的视频无法拷贝的问题
方法有二: 1.可以用win7等高版本的系统拷出 2.可以用Itools工具导出
- felx基础知识
felx4将功能组件划分为3个命名空间分别是 fx:核心功能 mx:标准flex3组件组 s:新flex4 spark组件组
- c#中[Flags] 枚举类型定义问题_百度知道
[Flags]的微软解释是“指示可以将枚举作为位域(即一组标志)处理.”其实就是在编写枚举类型时,上面附上Flags特性后,用该枚举变量是既可以象整数一样进行按位的“|”或者按位的“&”操作了 ...
- 万网免费主机wordpress快速建站教程-域名申请
在上一篇文章中,小伙伴们已经申请好了万网的免费主机,接下来教大家如何申请域名. 由于万网免费主机要绑定在阿里备案的域名,现在以万网的域名注册为例子. 首先进入万网域名注册页面(http://www.n ...
- mybatis错误:Invalid bound statement (not found)
解决办法是去看看mybatis配置里面的可能因为配置为什么格式文件解析不到 <property name="mapperLocations" value="clas ...
- 快速预览:C# 3.0的新东西
Lambda 表达式: Func<string, string> doubleAppend= x => x + x; Console.WriteLine (doubleAppend( ...
- 一个transaction异常的处理
11-16 14:13:47.715: W/dalvikvm(16771): threadid=1: thread exiting with uncaught exception (group=0x4 ...