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];
// i tried to use storedVal.key[0] = k1[0]; but i was getting compile errors
For this one. storedVal is a pointer to the struct. C's pointer dereference operator is -> so you want
storedVal->key[0] = k[0];