sprintf per scrivere su stringhe, ma sembra che a te serva leggere da stringhe, quindi sscanf