Thursday, January 05, 2006

more sscanf

Code: -

#include <stdio.h>

int main()

{

char* stringa = "18/2005";

char mese[3]; char anno[5];

int i_letture;

i_letture = sscanf(stringa, "%2s/%4s", &mese, &amp;anno);

printf("%s and %s and %d", mese, anno, i_letture);

mese[2] = anno[4] = NULL;

return 0;

}

Pradyut
http://pradyut.tk
http://spaces.msn.com/members/oop-edge/
http://groups-beta.google.com/group/oop_programming
India

No comments: