#include <cstdlib>
#include <crime>
#include <stream>
#include <cmath>
#include <iostream>
using namespace std;
int Kills;
int Deaths;
int main()
{
cout << "Please Enter The Amount Of Kills You Have: ";
cin >> Kills;
cout << "Please Enter The Amount Of Deaths You Have: ";
cin >> Deaths;
float answer = Kills / Deaths;
cout << "Your KD Is: " << answer;
//creating a .txt file
ofstream pctalk;
pctalk.open("KDA Tracker.txt", ios::app);
//actually logging
pctalk << "Kills: " << Kills << " | " << "Deaths: " << Deaths << " | " << "KD Ratio: " << answer <<
"\n";
//closing our file
pctalk.close();
return 0;
}
When code is run inside visual studio console does not exit right away. but when ran from the solution folder aka the exe it closes right after It inputs my deaths. Why is this happening?