AM> HB>sprintf(stringret, "%s%c", stringvar, charvar);
AM> This takes a long time to execute though
AM> int i = strlen(stringvar);
AM> stringvar[i++] = charvar;
AM> stringvar[i] = NULL;
AM> The above is much faster. ;-)
NULL is defined as being of type void *. If you want to be really
verbose about the null character, that should be '\0', which will be
clear enough for everybody:
1. people will see it's an ascii char.
2. compilers will see it's of type int, which is convertible to char.
NULL is reserved for pointers; i often use 0 instead, though. I'm not
sure whether it is actually desirable that i recommend using 0,
though... :-)
matju
--- Terminate 4.00/Pro
---------------
* Origin: The Lost Remains Of SatelliteSoft BBS (1:163/215.42)
|