playing with functions inside of headers
This commit is contained in:
parent
fc7454b099
commit
1f8cafa30c
20
lists/cpu.h
20
lists/cpu.h
@ -1,10 +1,18 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "hardware.h"
|
#include "hardware.h"
|
||||||
|
|
||||||
CPU A7800x3d;
|
|
||||||
A7800x3d.manufacturer = "AMD";
|
|
||||||
A7800x3d.ReleasedYear = 2024;
|
|
||||||
A7800x3d.architecture = "Zen 4";
|
|
||||||
A7800x3d.boostclock = 5.2;
|
|
||||||
A7800x3d.mainclock = 4.8;
|
|
||||||
|
|
||||||
|
void a7800x3d(){CPU A7800x3d;};
|
||||||
|
|
||||||
|
float a7800x3d(float mainclock, float boostclock){
|
||||||
|
CPU A7800x3d;
|
||||||
|
A7800x3d.mainclock = mainclock;
|
||||||
|
A7800x3d.boostclock = boostclock;
|
||||||
|
return mainclock,boostclock;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string a7800x3d(std::string man){
|
||||||
|
CPU A7800x3d;
|
||||||
|
A7800x3d.manufacturer = "AMD";
|
||||||
|
return man;
|
||||||
|
};
|
||||||
|
|||||||
@ -26,11 +26,11 @@ class CPU: public Hardware {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
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;
|
||||||
};
|
// };
|
||||||
|
|
||||||
// CPU A7800x3d;
|
// CPU A7800x3d;
|
||||||
// A7800x3d.manufacturer = "AMD";
|
// A7800x3d.manufacturer = "AMD";
|
||||||
|
|||||||
26
main.cpp
26
main.cpp
@ -1,25 +1,25 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "lists/hardware.h"
|
#include "lists/hardware.h"
|
||||||
|
#include "lists/cpu.h"
|
||||||
// std::string a7800x3d(std::string man){
|
|
||||||
// CPU A7800x3d;
|
|
||||||
// A7800x3d.manufacturer = "AMD";
|
|
||||||
// return man;
|
|
||||||
// };
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
// CPU A7800x3d;
|
/* Trying to declare a class with name A7800x3d
|
||||||
// A7800x3d.manufacturer = "AMD";
|
CPU A7800x3d;
|
||||||
// A7800x3d.ReleasedYear = 2024;
|
A7800x3d.manufacturer = "AMD";
|
||||||
// A7800x3d.architecture = "Zen 4";
|
A7800x3d.ReleasedYear = 2024;
|
||||||
// A7800x3d.boostclock = 5.2;
|
A7800x3d.architecture = "Zen 4";
|
||||||
// A7800x3d.mainclock = 4.8;
|
A7800x3d.boostclock = 5.2;
|
||||||
|
A7800x3d.mainclock = 4.8;
|
||||||
|
*/
|
||||||
|
// referencing the function a7800x3d from cpu.h
|
||||||
|
a7800x3d("AMD");
|
||||||
|
|
||||||
cout << a7800x3d("AMD");
|
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 Manufacturer is: " << A7800x3d.manufacturer << endl;
|
||||||
// cout << "The Main Clock Speed is: " << A7800x3d.mainclock << endl;
|
// cout << "The Main Clock Speed is: " << A7800x3d.mainclock << endl;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user