From 02d26b6c7a9afa222de591bcc800388ecb118d36 Mon Sep 17 00:00:00 2001 From: LYC Date: Mon, 28 Oct 2024 14:57:05 +0800 Subject: [PATCH] 5 --- cache/Project1/Proj1-1/Proj1-1/src/main.cc | 8 ++++---- cache/Project1/Proj1-1/Proj1-1/src/public.h | 8 +++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cache/Project1/Proj1-1/Proj1-1/src/main.cc b/cache/Project1/Proj1-1/Proj1-1/src/main.cc index 5a67829..8e43994 100644 --- a/cache/Project1/Proj1-1/Proj1-1/src/main.cc +++ b/cache/Project1/Proj1-1/Proj1-1/src/main.cc @@ -8,19 +8,19 @@ int main(int argc, char *argv[]) { if (argc != 7) { - throw "Para Err." + throw "Para Err."; } auto fileName = std::string(argv[6]); struct stat buffer; - if (stat(("../traces/" + tf).c_str(), &buffer)) + if (stat(("../traces/" + argv[6]).c_str(), &buffer)) { throw "traces file Err."; } - auto cache = new Cache(char *argv[]); + auto cache = new Cache(argv[]); - ifstream trace("../traces/" + p.TraceFile()); + ifstream trace("../traces/" + fileName); string line; char op; unsigned addr; diff --git a/cache/Project1/Proj1-1/Proj1-1/src/public.h b/cache/Project1/Proj1-1/Proj1-1/src/public.h index 783a9a3..469ccc3 100644 --- a/cache/Project1/Proj1-1/Proj1-1/src/public.h +++ b/cache/Project1/Proj1-1/Proj1-1/src/public.h @@ -10,4 +10,10 @@ #include #include #include -#include \ No newline at end of file +#include +#include +#include +#include +#include +#include +#include \ No newline at end of file