Thought id add some more, as a clearer example:
Code:
typedef struct ip
{
unsigned int ver:4;
} packet;
there is a snippet of structure
Code:
packet*my_packet_pointer;
FILE*ptrFileln;
printf("Enter the name of the binary file to read\n");
scanf("%s",&cFileName[0]);
if((ptrFileln=fopen(cFileName, "r"))==NULL)
{
printf("Failed to open file\n");
return(1);
}
while( fread( cBuffer,80,1,ptrFileln) != 0)
reading from my file
but moving the data from cBuffer and populating the structure is the bit i have no idea about.
sorry about the untidy code, its a work in progress