Tuesday, 15 February 2011

c++ - Dynamic array of function pointers without typedef -



c++ - Dynamic array of function pointers without typedef -

this question has reply here:

array of function pointers without typedef 3 answers

i've got this:

void (**funcs)(); funcs = new void (*)()[n];

and getting errors void, parenthesis, etc. right syntax?

i know vectors want know how done way.

if insist on using raw pointers reason, or you're curious, syntax is:

void (**funcs)() = new (void(*[100])());

seriously, utilize std::vector:

std::vector<void(*)()> vec;

c++ pointers function-pointers

No comments:

Post a Comment