LV> "a:\cpp\filename.cdm" and I want to change its file extension
LV> so it reads "a:\cpp\filename.trk"
You can assume (dos & win3.x) that the string will only have
one period in it. Then you can do the following.
find the position of the period
make sure there are 3 chars following the period
replace .XXX with .YYY
const char *strchr(const char *s, int c); // C++ only
strchr scans a string in the forward direction, looking for a specific
character. strchr finds the first occurrence of the character c in the
string s. The null-terminator is considered to be part of the string.
size_t strlen(const char *s);
strlen returns the number of characters in s, not counting the
null-terminating character.
--- GEcho 1.00
---------------
* Origin: Digital OnLine Magazine! - (409)838-8237 (1:3811/350)
|