Thread Callbacks und Closures?: Kann mal einer was dazu erzählen. (32 answers)
Opened by Ronnie at 2003-11-23 22:15

esskar
 2003-12-01 19:16
#72658 #72658
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
so...

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>

typedef struct tagNewPrint
{
char *p1;
tagNewPrint(char* a) : p1(a) { }
void operator()(char* x) { printf("%s, %s!\n", p1, x); }
} NewPrint;

int main()
{
NewPrint h("Howdy");
NewPrint g("Greetings");

h("world");
g("earthlings");

return 0;
}

View full thread Callbacks und Closures?: Kann mal einer was dazu erzählen.