I wrote a very simple .dat utility that can read write and convert dat to a text text file. I would like the user to be able to specify the where the file is instead of the way i wrote my code, where the file has to be named data.dat and saved to the directory the program is in. Anyone have any idea how to let the user specify the directory??? I don't have tremendous skills in c++ so...

Here is my code so far:

Code:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main () {
    int ans;
    int l = 1;
    

	char String[50];
	
	main:

	cout << "\nData Reader V1.0 -----------------------------------------------------\n";
	cout << "1] Write Data To .dat File\n";
	cout << "2] Read .dat Data\n";
	cout << "3] Output Data To DatConversion.txt\n";
	cout << "--------------------------Enter Selection-----------------------------\n";
	cout << "                                ";
	cin >>  ans;
	

	
	if (ans == 1){
    cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
	ofstream outputFile("Dat.dat"); 
  	ifstream inputFile;
  	
	
              
    cout << "--------------------------Data Input---------------------------------\n";
    
    textinput:
 
 	cin.getline( String, 50, '\n');
	

	outputFile << String;
	l = l + 1;
	if (l == 10){
          
          outputFile.close();

	      
          
          system("pause");
          
          cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
          
          goto main;
          
          }

	goto textinput;
    }
    
    
    
    if (ans == 2){
            cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
            ifstream inputFile;
          inputFile.open("Data.dat");

	      cout << "Reading string from Data.dat ...\n";

	      inputFile.getline(String, 50, '\n');

          cout << String;
          
          cout<<"\n Press Any Key To Go Back.\n";
          
          system("pause");         
          
          inputFile.close();
          
          cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
          
          goto main;
          }
    //dat converter      
    if(ans == 3){
           
           cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
           
           //Reading Data
           
           ifstream inputFile;
           
           inputFile.open("Data.dat");

	       cout << "Reading string from file...\n";

	       inputFile.getline(String, 50, '\n');
	       
	       inputFile.close();
	       
	       //write to data to txt file
	       
	       ofstream outputFile("DatConversion.txt", ios::app);
	       
	       outputFile.open("DatConversion.txt");           
           
           cout<<"\nWriting...";
           
           outputFile << String;
           
           outputFile.close();
           
           cout<<"\n Press Any Key To Go Back.";
          
          system("pause");
          
          cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";         
          
          goto main;
          }
           
          
  
      return 0;
  
  
}