How to define an array of functions in C
I have a struct that contains a declaration like this one: void (*functions[256])(void) //Array of 256 functions without arguments and return value And in another function I want to define it, but there are 256 functions! I could do something like this: struct.functions[0] = function0; struct.functions[1] = function1; struct.functions[2] = function2; And so on, but this is too tiring, my question is there some way to do something like this? struct.functions = { function0, function1, function2, function3, ..., }; EDIT : Syntax error corrected as said by Chris Lutz. I have a struct that contains