/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,
C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <stdio.h>
#include "actions.h"
#include "button.h"
Actions actions;
Button button;
int main()
{
actions = Actions();
button = Button();
button.onClick(actions.doSmthg);
printf("Hello World");
return 0;
}
class Button {
public:
Button() {};
void onClick(void (*callbackPtr)());
void (*callbackPtr)();
};
#include "button.h"
void Button::onClick(void (*callbackPtr)()){
this->callbackPtr = callbackPtr;
}
class Actions {
public:
Actions();
void doSmthg();
};
#include <stdio.h>
#include "actions.h"
Actions::Actions() {}
void Actions::doSmthg() {
printf("I did a thing");
}