Answer the question
In order to leave comments, you need to log in
Why is this happening and where is the error?
I am writing a password manager in C++. He has a settings file, which initially contains 0, which means that the person has not yet entered the password vault.
conf.open("config.txt");
conf >> con;
conf.close();
if (con == 0){
firstlaunch();
}
conf.open("config.txt", ios_base::out);
conf << 1 << endl;
conf.close();
#include "stdafx.h"
#include <iostream>
#include <time.h>
#include <fstream>
#include <string>
#include <Windows.h>
Answer the question
In order to leave comments, you need to log in
So, now try to improve your question so that it can be answered.
1. A screenshot of a running application is great, but it's not clear why it is needed.
2. Screenshot of a piece of errors - it's not clear what kind of errors there are. Figure out how to copy the build log from the studio and get these messages out of there.
3. After reading from the file, check the value of the con variable and display it on the screen to make sure that the wrong number is being read from the file.
If there is not the right number, then check the type of this variable - maybe you wrote char "1" there and read it already as int or vice versa.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question