>> string num2text(float n)
Did you need to make that function? Couldn't you have just used itoa?
EDIT - Here's an example I used when I had to download 3000 files, but didn't want to do it manually. The files which I downloaded changed according to a date - starting in 85, and endint in 95 or something like that.
(The coloring program I used crashes when I put this code through it, so ye'll have to bear with regular code ... sigh)
Code:
string FromSite = "http://something.com/";
string ToFile = "C:\\";
int Year = 85,
Month = 11,
Date = 17;
bool EndMonth = false;
char Temp[20];
// Append Dates
itoa( Year, Temp, 10 );
FromSite.insert ( FromSite.length (), Temp );
ToFile.insert ( ToFile.length(), Temp );
FromSite.insert ( FromSite.length(), "/ch" );
FromSite.insert ( FromSite.length(), Temp );
if ( Month<=9 )
{
itoa( 0, Temp, 10 );
FromSite.insert ( FromSite.length(), Temp );
ToFile.insert ( ToFile.length(), Temp );
}
itoa( Month, Temp, 10 );
FromSite.insert ( FromSite.length(), Temp );
ToFile.insert ( ToFile.length(), Temp );
if ( Date<=9 )
{
itoa( 0, Temp, 10 );
FromSite.insert ( FromSite.length(), Temp );
ToFile.insert ( ToFile.length(), Temp );
}
itoa( Date, Temp, 10 );
FromSite.insert ( FromSite.length(), Temp );
ToFile.insert ( ToFile.length(), Temp );
FromSite.insert ( FromSite.length(), ".gif" );
ToFile.insert ( ToFile.length(), ".gif" );
etc. The rest of this code is irrelevant to the thread.