Now use, write a function of modifying the file extension ~~~~~~~

xiaoxiao2021-03-18  196

#include

Using namespace std;

/ *

* Assistant Function,

* Return A String, Get Tow String &,

* Use to change a filename's extern name;

* Author: lonelyforest

* Date: 2006.03.15

* /

String change_file_ext (const string & filename, const string& new_ext)

{

INT Dot_POS = 0;

String Temp = filename;

For (int i = 0; i

{

IF (Temp [i] == '.')

{

Dot_pos = i;

}

}

TEMP.ERASE (DOT_POS);

TEMP = new_ext;

Return Temp;

}

Not very good, I hope to advise.

转载请注明原文地址:https://www.9cbs.com/read-129879.html

New Post(0)