Guest User

Untitled

a guest
Jan 17th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. class ofApp : public ofBaseApp{
  2.  
  3. public:
  4. void setup();
  5. void update();
  6. void draw();
  7.  
  8. int addition (int a);
  9. int operation (int a, int (*f)(int));
  10. };
  11.  
  12. void ofApp::setup(){
  13. operation(1, std::bind(&ofApp::addition, this));
  14. }
  15.  
  16. int ofApp::addition (int a){
  17. return (a+a);
  18. }
  19.  
  20. int ofApp::operation (int a, int (*f)(int)){
  21. int g = 0;
  22. g = (*f)(a);
  23. return (g);
  24. }
Add Comment
Please, Sign In to add comment