monorepo
This commit is contained in:
24
P1/smt4497-P1/smt4497-P1-matrices.cpp
Normal file
24
P1/smt4497-P1/smt4497-P1-matrices.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "smt4497-P1.h"
|
||||
|
||||
void LeeFabricanteCPU(char fabricante[], int tamfabricante)
|
||||
{
|
||||
|
||||
int info[4];
|
||||
__cpuid(info, 0);
|
||||
int* p;
|
||||
p = (int*) fabricante;
|
||||
|
||||
//usando puntero interpretando como int
|
||||
p[0] = info[1];
|
||||
p[1] = info[3];
|
||||
p[2] = info[2];
|
||||
|
||||
//p[3] = 0; // puede ser un error porque "rellena mas 0's"
|
||||
|
||||
//usando memcpy interpretando como char
|
||||
//memcpy(&fabricante[0], &info[1], 4); // == &fabricante
|
||||
//memcpy(&fabricante[4], &info[3], 4);
|
||||
//memcpy(&fabricante[8], &info[2], 4);
|
||||
|
||||
fabricante[12] = 0;
|
||||
}
|
||||
Reference in New Issue
Block a user