Get visual studio 2013 express or something like that.
Were you planning on asking people on this forum to keep compiling your code for you for the foreseeable future?
Ok, so I just ran the program, and It DIDNT open the file. I even did the 2 slashes, so why doesnt it open the file?! It does save the password to the file but does not open it.
The path exists, and the file exists. I'm not quite sure what you mean when you say "does your program have enough permissions to open that file?" After all its juts a .txt file, so it should require any admin privileges?
This is the code I have so far:
[#include <iostream>
#include <fstream>
#include <string>
#include <windows.h>
using namespace std;
int main()
{
system ("Color 2");
string input;
cout << "Enter the input: ";
getline(cin, input, '\n');
cout << endl;
// Create a new file named "Password_file.txt" and write the input to it
ofstream out("Password_File.txt");
out << input;
out.close();
cout << "Enter 'Open' to display your input from file: ";
getline(cin, input, '\n');
cout << endl;
if (input == "Open" || input == "open"){
string inputRead;
// Open "Password_File.txt" file and read the first line
ShellExecute(NULL, "open", "C:\\Users\\battl_000\\Desktop\\PASSWORD_FILE.txt", NULL, NULL, 0);
Your code works fine.
I want a screenshot proving file existence in that directory.
Something like that: http://puu.sh/fc5ch/b59a2ccf5d.png
Do you really launch your program from desktop?