>> int *numbers = malloc (50 * sizeof *numbers);
you should never dereference a NULL or invalid pointer - sometimes it may work while other times it will trigger an access violation. if you want to make the code easier to change, just typedef the data type, ie:
Code:int size = 1024; typedef int data_t; data_t * data = malloc(size * sizeof(data_t));