typedefstruct{
int nrecords; //Number of records
int recordsPerPage; //Records Per Page
int recordSize; //Record size
int PAGEID; //stores the first empty page
int SLOT; //stores the first empty slot
int sizeOfAttribute; //store the sizeof Attribute
char* attributes; //stores the attributes of the table
}REM_FileSubHeader;
and i use memcpy to pass the parametres and copy them to a ppData pointer.Here is how i copy them.
It seems that everything is ok.I save them into a file using a function.The function is not made from me and it is correct.When i open this using the oposite memcpy like this
i just can't see the rfh.attributes.My output is this: È÷ÿ¿o world asdqweasdqweNetBeansProjects/STORM/dist/Debug/GNU-MacOSX/storm
and it should be this:"Hello world asdqweasdqwe".I don't really know why.Can anyone help me?Thanks.
I know that this is not the best way to assign but this is what our professor wants to do.So.....By the way i found my mistake.Every string has the "\0" character which i didn't remember.