I\'m very new to C, and I am having trouble with fwrite.
I\'m looking to use a struct that holds two values:
struct keyEncode{ unsigned short key[2];
Assuming you only have one such struct, then you need to change:
fwrite(storedVal, sizeof(storedVal), 0xffff, fp);
to
fwrite(storedVal, sizeof(*storedVal), 1, fp);