(post deleted by author)

(post deleted by author)

Do you know how to use the sizeof operator?

(post deleted by author)

If you have a variable, of any type, you can use the sizeof operator to work out how many bytes to store.

(post deleted by author)

Your variable will be exactly where you left it

(post deleted by author)

to0n7:
And what's the opposite function of sizeof to refind my variable.

You need to make your program remember the location in the FRAM where you stored the variable.

(post deleted by author)

int myValue = 1234;
...
void* pVal = (void*) &myValue; // can be used to both read and write myValue
...
int bytesToWriteOrRead = sizeof (myValue);
...
...

(post deleted by author)