Re: Hrm, problems with color and "strcat"

From: Pink Floyd (floyd@south.mit.edu)
Date: 10/31/95


   Heh, i have been having troubles with strcat's and color recently.
   I have read through color.doc, but it only shows sprintf's...
   Hrm...well heres an example:

   strcat(buf, "...it glows with a bright aura");

   i would have no problems if it was sprintf, but since its strcat...
   it has totally confused me.  I know i gotta make a new buffer for color,
   but not sure how/where i should put it.

Try something like this:

  char tempbuf[256];
...
  sprintf(tempbuf, "%s...it glows with a bright aura%s", CCRED(ch, C_NRM),
	CCNRM(ch, C_NRM));  /* will make this ^^^ sentence red, presumably */
  strcat(buf, tempbuf);

I think this would work, of course you'll have to modify it to suit your needs.



This archive was generated by hypermail 2b30 : 12/07/00 PST