I was able to fix it as shown below...thanks for all your help
---------------------------------------------------------------------------------------
/* This program will allow a user to enter a name of a file either
a txt, dat, or any type of file. Then once this file name is
entered by user, then the (ofstream myfile;) will allow you to
save it. Then the user get to input stuff into the file and
save everything in the text.
*/
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
#include <cstring>
using namespace std;
int main ()
{
char open_myFile[16]; //this will allow the file name be 16 in length
cout << "Enter the name of an existing file: " << flush;//
cin.getline ( open_myFile,17 ); //this will allow a string to be enter of length 16
// ***************************************************** //these lines below will allow for file to be open & cout content of file
ifstream file; //declares name "file" as ifstream
file.open ( open_myFile ); //this line open the file named: open_myFile
if (file.is_open()) //if file open then executes (.is_open() means if file opens fine)
{
while (file.good()) //while file is good (.good)
cout << (char) file.get(); //gets all characters/strings in file with get ( .get() )
file.close(); //closes file after it has cout everything in it
}
else
{
cout << "Error opening file";
}
// *****************************************************
cout << "\n\n\n";
system ("pause");
return 0;
}