
Untitled
By: a guest on
May 9th, 2011 | syntax:
C++ | size: 0.61 KB | hits: 89 | expires: Never
#include "Function.h"
#include <iostream>
void HelloWorld(int iterations){
for(int i = 0; i<iterations; i++){
std::cout << "Hello, World!" << std::endl;
}
}
class SillyHello {
private:
const char* name;
public:
SillyHello(){
name = "Class Hello World";
}
void displaySelf(){
std::cout << name << std::endl;
}
};
int main(){
Function<void, int> hello(HelloWorld);
hello(3);
SillyHello chickenfeet;
Function<void> helloclass(&chickenfeet, &SillyHello::displaySelf);
helloclass();
Function<void> doubley = helloclass;
doubley();
return 0;
}