Hello
I am writing a library which will write data to a user defined callback
function. The function the user of my library will supply is:
int (*callbackfunct ion)(const char*);
In my libary do I create a function where user passes this callback
function? How would I define the function?
I tried this
callbackfunctio n clientfunction;
void SpecifyCallback function(cbFunc tion cbFn)
{
clientfunction = cbFn;
}
Then called like this:
clientfunction( sz); // sz is a C-string.
But program crashes with access violation when attempt to call
clientfunction
What am I doing wrong?
I am writing a library which will write data to a user defined callback
function. The function the user of my library will supply is:
int (*callbackfunct ion)(const char*);
In my libary do I create a function where user passes this callback
function? How would I define the function?
I tried this
callbackfunctio n clientfunction;
void SpecifyCallback function(cbFunc tion cbFn)
{
clientfunction = cbFn;
}
Then called like this:
clientfunction( sz); // sz is a C-string.
But program crashes with access violation when attempt to call
clientfunction
What am I doing wrong?
Comment