Results 1 to 5 of 5

Thread: A rainbow text color program

Threaded View

  1. #1
    ChimpFace9000
    Guest

    Post

    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....

    Code:
    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.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width