TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: SADOVNIKOV SERGEY
from: BOB STOUT
date: 1997-06-14 18:23:00
subject: String manipulation

On , Sadovnikov Sergey (2:5020/760.14@fidonet) wrote: 
 >     Try following case:
 >    void ChangeExt(char * NewName,char * OldName,char * NewExt)
 >    {
 >        char * Temp;
 >        strcpy(NewName,OldName);    // Make copy of OldName
 >        Temp = strchr(NewName,'.'); // Finding dot in OldName
 >        if(Temp)
 >           strcpy(Temp,NewExt);     // If dot present, cnange extention
 >        else
 >           strcat(NewName,Ext);     // else adding extention to NewName
 >    }
Sadovnikov...
  Try it with a path name like \root.dir\foo\bar\foo.bar\wumpus.txt and 
you'll see some of the problems that the SNIPPETS code knows how to avoid. 
;-) 
--- QM v1.00
---------------
* Origin: MicroFirm : Down to the C in chips (1:106/2000.6)

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