One option is to just use an int array.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//How many to read in one pass
const int num_of_items = 80;
int main(void)
{
FILE *input;
int *buffer_input;
int i, items;
buffer_input = malloc(num_of_items*sizeof(int));
/*************************************************/
/* open input file */
/*************************************************/
if (buffer_input == NULL)
printf("buff alloc failed\n");
if ((input = fopen("DD:IN","rb")) == NULL)
{
printf("open of IN DD failed\n");
exit(-1);
}
else
{
printf("Successful open\n");
}
/*************************************************/
/* perform first read into buffer */
/*************************************************/
while (items = fread(buffer_input,sizeof(int),num_of_items,input))
{
for (i=0; i<items; i++)
printf("\nhex = %x\n",buffer_input[i]);
}
free(buffer_input);
return 0;
}