ChimpFace9000
Feb 26th, 2001, 09:33 PM
Recently there was talk about a program that will create a rainbow effect using html code. So i thought id try making my own. The problem is i keep getting an illegal operation error whenever i run it. I think the problem is in this function....
void GenerateCode(char *String, char *Buffer)
{
int sLength = strlen(String);
int Total = White - Black;
int IncAmount = Total / sLength;
int Count = 1;
int Color = Black;
while(Count <= sLength)
{
strcat(Buffer, "<FONT COLOR=\"");
strcat(Buffer, (const char*)Color);
strcat(Buffer, "\">");
strcat(Buffer, (const char*)String[Count]);
strcat(Buffer, "</FONT>");
Color = Color + IncAmount;
Count++;
}
return;
}
If you see a problem in there please let me know, i havent used C++ in a while so i might be forgetting something. Ive also included the full source for those who want to see it.
void GenerateCode(char *String, char *Buffer)
{
int sLength = strlen(String);
int Total = White - Black;
int IncAmount = Total / sLength;
int Count = 1;
int Color = Black;
while(Count <= sLength)
{
strcat(Buffer, "<FONT COLOR=\"");
strcat(Buffer, (const char*)Color);
strcat(Buffer, "\">");
strcat(Buffer, (const char*)String[Count]);
strcat(Buffer, "</FONT>");
Color = Color + IncAmount;
Count++;
}
return;
}
If you see a problem in there please let me know, i havent used C++ in a while so i might be forgetting something. Ive also included the full source for those who want to see it.