please help! having trouble getting the final result, it is not subtracting the input suffixes
A common string processing operation is constructing an output file name from an input file name. Write a program outName.cpp that prompts and reads an “input” file name and constructs an “output” file name from the input file name by replacing the suffixes “.in” or “.input” or “.data” with the suffix “.output”. Your program will not actually open any files for reading or writing. It is only creating a file name.
// FUNCTION PROTOTYPE FOR construct_output
void construct_output(string & in_name, string & out_name)
// Two parameters: in_name and out_name (input and output file names respectively
// Parameters are passed by reference
{
int length(0); // Length of string
length=in_name.length(); // Sets length equal to characters in input file name
out_name=in_name; // Sets characters of both input and output file names equal