srand(GetTickCount()); _snprintf(buffer, 8, "%i", buffer, rand()%10); printf (buffer);