Small doubt regarding function pointers as you can see the array of function pointers is initialized with two elements, but i am calling up to 3. In such cases what is the behavior of the program? How to avoid using MAX?
Code:
void Test1(void);
void Test2(void);
#define MAX 3
for(i = 0; i < MAX; i++)
{
(*funcptr[i])();
}
void (*funcptr[])(void) =
{
Test1,
Test2,
};
Comment