Ejemplo n.º 1
0
int doThis(int v){
  int rc=1;
  if(v > 0){
    rc =v* doThis(v-1);
  }
  return rc;
}
Ejemplo n.º 2
0
int main (int argc, char *argv[]) {
	game data;
	game *dataPtr = &data;
	data.p1.money = 1;
	printf("%d\n", data.p1.money);
	doThis (dataPtr);
	printf("%d\n", data.p1.money);
	return EXIT_SUCCESS;
}
Ejemplo n.º 3
0
/**
 * Do something to every module which is registered.
 * @param doThis the callback.
 * @param registry state.
 */
static void forEachModule(int (*doThis)(struct DHTModule* module, struct DHTMessage* message),
                          struct DHTMessage* message,
                          const struct DHTModuleRegistry* registry)
{
    struct DHTModule** modulePtr = registry->members;
    struct DHTModule* module = *modulePtr;
    while (module) {
        if (doThis(module, message) != 0) {
            return;
        }
        modulePtr++;
        module = *modulePtr;
    }
}
Ejemplo n.º 4
0
int main(void){
  int x = 3;
  int y = doThis(x);
  printf("%d\n",y);
}