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

Mon Jun 09 1997 12:23, Bob Stout wrote to Sadovnikov Sergey:
 BS>   It *only* works for Borland! These functions aren't ANSI/ISO or
 BS> even Posix standard. There are portable equivalents in SNIPPETS,
 BS> though - see FNSPLIT.C.
    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
   }
                                                           Commander Wolf
--- 2.50+
---------------
* Origin: *) Commander Wolf (* Moscow, Russia (2:5020/760.14)

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