LV> I have a string:
LV> "a:\cpp\filename.cdm" and I want to change its file
LV> extension so it reads "a:\cpp\filename.trk"
You can do this easily using the string.h library.
char filestring[256] = "a:\cpp\filename.cdm", *temp;
temp = strchr(filestring, '.');
*temp = '\0';
strcat(filestring, ".trk");
Or you can just do a direct strcpy() to the address.
char filestring[256] = "a:\cpp\filename.cdm";
strcpy(1 + strchr(filestring, '.'), "trk");
> ] Redundancy: Playing "Battle of Evermore" during housework...
---
---------------
* Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750)
|