function pointer

L

Logix

I'm trying to typedef a function pointer to the following type of
function:

FeaTAnyInstrument* allocateOption(CalculateVarDataHolder
*varDataHolder, JNIEnv *env, jobject inputObj, FeaTInstrumentType type)
{


Does anyone know why the following code

typedef (FeaTAnyInstrument*) (*AllocFuncPtr)(CalculateVarDataHolder*,
JNIEnv*, jobject, FeaTInstrumentType);


generates the following error?

instrumentlogic.h(11) : error C2226: syntax error : unexpected type
'FeaTAnyInstrument'


Thanks!
 
R

Rapscallion

Logix said:
I'm trying to typedef a function pointer to the following type of
function:

FeaTAnyInstrument* allocateOption(CalculateVarDataHolder
*varDataHolder, JNIEnv *env, jobject inputObj, FeaTInstrumentType type)
{

JNI. I pity you! What have you done to deserve this.
Does anyone know why the following code

typedef (FeaTAnyInstrument*) (*AllocFuncPtr)(CalculateVarDataHolder*,
JNIEnv*, jobject, FeaTInstrumentType);

typedef FeaTAnyInstrument* (*AllocFuncPtr)(CalculateVarDataHolder*,
JNIEnv*, jobject, FeaTInstrumentType);

No braces? Is FeaTAnyInstrument a declared type?
 
V

Victor Bazarov

Logix said:
I'm trying to typedef a function pointer to the following type of
function:

FeaTAnyInstrument* allocateOption(CalculateVarDataHolder
*varDataHolder, JNIEnv *env, jobject inputObj, FeaTInstrumentType
type) {


Does anyone know why the following code

typedef (FeaTAnyInstrument*) (*AllocFuncPtr)(CalculateVarDataHolder*,
JNIEnv*, jobject, FeaTInstrumentType);


generates the following error?

instrumentlogic.h(11) : error C2226: syntax error : unexpected type
'FeaTAnyInstrument'

First of all, remove the parentheses around 'FeaTAnyInstrument*'.

Second, is that type defined before you attempt the typedef?

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,206
Messages
2,571,068
Members
47,675
Latest member
KevinStepp

Latest Threads

Top