Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

How to call non-static member function from static member function

$
0
0

@cuinjune wrote:

Hi, I'm trying to call a non-static member function from a static member function in OF.
What would be the easiest way to do it?

For example, if I want to call update() from staticFunction(), how can I do it?
Thank you so much.

void ofApp::setup(){

    staticFunction();
}

void ofApp::staticFunction(){

    update(); //error : call to non-static member function without an object argument
}

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles