Save Variable on SD Card


I have to save Variable to the SD Card. The Variable is simple, like:

int ledState = LOW


volatile unsigned int encoderPos = 80;

Both Variables are before the SetUp and they will be Changed in the Loop. Is there a simply way to write those Variables (if they are Changed) on the SD Card?

Regards, Maverick

Arduino IDE