TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: LEON VARGHESE
from: KURT KUZBA
date: 1997-06-10 14:57:00
subject: String manipulation

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.