From 67771502ef5b93719da5a72e0cb62d3ba265083b Mon Sep 17 00:00:00 2001 From: Tuhin Mondal Date: Mon, 17 Jun 2024 22:21:11 -0700 Subject: [PATCH] Added function pointer for indented display --- CPU.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CPU.h b/CPU.h index 847572c..3324cdc 100644 --- a/CPU.h +++ b/CPU.h @@ -57,7 +57,11 @@ public: // Friend function declarations friend void display(const CPU &cpu); - friend void iDisplay(const CPU &cpu, int level); + friend void iDisplay(const CPU& cpu, int level) { + for (int i = 1; i < level; i++) + std::cout << ".."; + std::cout << level << "). " << cpu.cpuId << std::endl; + }; friend std::ostream &operator<<(std::ostream &os, const CPU &cpu);