Function Pointer in C Language
The only error in your code is this line: void task1();

This is only function prototype. You need to write function defination. 

Replace this line with following code :

void task1()
{
  /* Write some code here */
  Nop();//No operation
}


Just writing function prototype will not allocate memory.