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