backup before Testing out pointers on classes
This commit is contained in:
parent
22f6da97f4
commit
0b9ea99c8c
@ -1,9 +1,18 @@
|
|||||||
void setCPU(){};
|
void setCPU(){};
|
||||||
|
|
||||||
void setCPU(std::string model, float mainclock, float boostclock) {
|
|
||||||
mainclock = mainclock;
|
void setCPU(std::string mmodel, float mmainclock, float mboostclock) {
|
||||||
boostclock = boostclock;
|
A7800x3d.mainclock = mmainclock;
|
||||||
|
A7800x3d.boostclock = mboostclock;
|
||||||
// model.boostclock = boostclock; // This doesnt work because its not a vaild reference!
|
// model.boostclock = boostclock; // This doesnt work because its not a vaild reference!
|
||||||
// Trying to use the local model var to call the global CPU class for that specific model
|
// Trying to use the local model var to call the global CPU class for that specific model
|
||||||
cout << "\n\n\n" << model << ".mainclock\n\n" << endl;
|
cout << "Coming from the setCPU function in setcpu.h" << endl;
|
||||||
|
cout << "\n\n\n" << mmodel << ".mainclock\n\n" << endl;
|
||||||
|
cout << "\n\n" << i75820k.boostclock << "\n\n" << endl;
|
||||||
|
cout << "Leaving setCPU()\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//void setCPU(CPU *mA7800x3d, double mmainclock) {
|
||||||
|
//mA7800x3d->mainclock = mmainclock;
|
||||||
|
//}
|
||||||
|
|||||||
10
lists/cpu.h
10
lists/cpu.h
@ -21,8 +21,8 @@ void a7800x3d(float mainclock, float boostclock){
|
|||||||
// return mainclock, boostclock;
|
// return mainclock, boostclock;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string a7800x3d(std::string man){
|
// std::string a7800x3d(std::string man){
|
||||||
CPU A7800x3d;
|
// CPU A7800x3d;
|
||||||
A7800x3d.manufacturer = "AMD";
|
// A7800x3d.manufacturer = "AMD";
|
||||||
return man;
|
// return man;
|
||||||
};
|
// };
|
||||||
|
|||||||
@ -47,9 +47,3 @@ CPU A7800x3d;
|
|||||||
// Spawn a CPU class for the Intel i7 5820k
|
// Spawn a CPU class for the Intel i7 5820k
|
||||||
CPU Ii75820k;
|
CPU Ii75820k;
|
||||||
|
|
||||||
// CPU A7800x3d;
|
|
||||||
// A7800x3d.manufacturer = "AMD";
|
|
||||||
// A7800x3d.ReleasedYear = 2024;
|
|
||||||
// A7800x3d.architecture = "Zen 4";
|
|
||||||
// A7800x3d.boostclock = 5.2;
|
|
||||||
// A7800x3d.mainclock = 4.8;
|
|
||||||
|
|||||||
8
main.cpp
8
main.cpp
@ -4,6 +4,8 @@
|
|||||||
#include "lists/cpu.h"
|
#include "lists/cpu.h"
|
||||||
#include "include/setcpu.h"
|
#include "include/setcpu.h"
|
||||||
|
|
||||||
|
void* ptr = &A7800x3d;
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@ -15,12 +17,16 @@ int main() {
|
|||||||
i75820k.model = "i75820k";
|
i75820k.model = "i75820k";
|
||||||
i75820k.manufacturer = "Intel";
|
i75820k.manufacturer = "Intel";
|
||||||
|
|
||||||
setCPU("i75820k", 3.2, 3.6);
|
setCPU("A7800x3d", 4.8, 5.2);
|
||||||
|
setCPU("i75820k", 3.2, 3.8);
|
||||||
|
// setCPU(A7800x3d, 4.8);
|
||||||
|
|
||||||
|
|
||||||
cout << "The " << A7800x3d.model << "'s Manufacturer is: " << A7800x3d.manufacturer << endl;
|
cout << "The " << A7800x3d.model << "'s Manufacturer is: " << A7800x3d.manufacturer << endl;
|
||||||
cout << "The Main Clock Speed is: " << A7800x3d.mainclock << endl;
|
cout << "The Main Clock Speed is: " << A7800x3d.mainclock << endl;
|
||||||
cout << "The Boost Clock Speed is: " << A7800x3d.boostclock << endl;
|
cout << "The Boost Clock Speed is: " << A7800x3d.boostclock << endl;
|
||||||
|
cout << "\n\nThe pointer is: " << ptr << endl;
|
||||||
|
// cout << "The pointer is: " << *ptr.manufacturer << endl;
|
||||||
|
|
||||||
system("sleep 3s");
|
system("sleep 3s");
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user