Moved CPU declarations back into main.

This commit is contained in:
ganome 2025-01-28 13:38:55 -07:00
parent 1f8cafa30c
commit cae63ebe2a
Signed by untrusted user who does not match committer: Ganome
GPG Key ID: 944DE53336D81B83
3 changed files with 30 additions and 7 deletions

View File

@ -1,14 +1,24 @@
#pragma once
#include "hardware.h"
using namespace std;
CPU i75820k;
void a7800x3d(){CPU A7800x3d;};
// Testing a function to create the class - cant access the class from main function though.
void a7800x3d(){
CPU A7800x3d;
cout << "Initial Main Clock: " << A7800x3d.mainclock << "\n" << A7800x3d.boostclock << endl;
};
float a7800x3d(float mainclock, float boostclock){
void a7800x3d(float mainclock, float boostclock){
CPU A7800x3d;
A7800x3d.mainclock = mainclock;
A7800x3d.boostclock = boostclock;
return mainclock,boostclock;
std::cout << "Main clock is: " << A7800x3d.mainclock << "\nBoost clock is: " << A7800x3d.boostclock << endl;
// return mainclock, boostclock;
};
std::string a7800x3d(std::string man){

View File

@ -20,6 +20,7 @@ class CPU: public Hardware {
float mainclock;
float boostclock;
std::string architecture;
std::string memoryrange;
std::string getmanufacturer(std::string manufacturer){
return manufacturer;

View File

@ -3,6 +3,14 @@
#include "lists/hardware.h"
#include "lists/cpu.h"
void setupCPU(std::string model, float mainclock, int cores){
i75820k.model = model;
i75820k.mainclock = mainclock;
i75820k.cores = cores;
};
//
int main() {
using namespace std;
@ -15,11 +23,15 @@ int main() {
A7800x3d.boostclock = 5.2;
A7800x3d.mainclock = 4.8;
*/
// referencing the function a7800x3d from cpu.h
a7800x3d("AMD");
// referencing the function a7800x3d from cpu.h and initialize the class
// a7800x3d();
// a7800x3d(4.8, 5.2);
cout << "Setting 7800x3d Manufacturer to AMD : " << a7800x3d("test") << endl;
cout << "Setting the clock speeds to: Main: " << a7800x3d(4.8,5.2) << endl;
setupCPU("i75820k", 3.2, 6);
cout << "cores: " << i75820k.cores << endl;
// cout << "Setting 7800x3d Manufacturer to AMD : " << a7800x3d("test") << endl;
// cout << "Setting the clock speeds to: Main: " << a7800x3d(4.8,5.2) << endl;
// cout << "The Manufacturer is: " << A7800x3d.manufacturer << endl;
// cout << "The Main Clock Speed is: " << A7800x3d.mainclock << endl;