Skip to content

Commit

Permalink
Settings file fix
Browse files Browse the repository at this point in the history
  • Loading branch information
R0STUS committed Sep 27, 2024
1 parent 0740415 commit 491898f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions compile.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
g++ src/main.cpp -o crystaller
Binary file modified crystaller
Binary file not shown.
9 changes: 6 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ int main() {
long maxMem = 2560;
std::string tmp;
std::ifstream settingsFile;
settingsFile.open("MemoryMax.txt");
if (settingsFile) {
settingsFile.open("settings.file");
if (!settingsFile) {
}
else {
settingsFile >> tmp;
maxMem = stol(tmp);
}
settingsFile.clear();
settingsFile.close();
tmp.clear();
tmp.shrink_to_fit();
std::cout << "Max. Memory for proccess: " << maxMem << std::endl;
Expand All @@ -64,4 +67,4 @@ int main() {
}
sleep(1);
}
}
}

0 comments on commit 491898f

Please sign in to comment.