Upload files to "struct"
This commit is contained in:
parent
ff1b5c109a
commit
271a16128e
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
AUTORE: Manuel Vichi
|
||||
(WIP) Dato
|
||||
*/
|
||||
#include <iostream>
|
||||
#include <array>
|
||||
#include <vector>
|
||||
#include <cstdlib>
|
||||
#define SIZEARRAY 10
|
||||
using namespace std;
|
||||
typedef struct {
|
||||
int numero;
|
||||
float valore;
|
||||
char simbolo;
|
||||
} Dato;
|
||||
|
||||
Dato riempiArray(Dato arr[], size_t size) {
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
arr[i].numero = rand() % 100;
|
||||
arr[i].valore = rand() % 1.5f;
|
||||
arr[i].simbolo = 'A' + rand() % 65;
|
||||
}
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
Dato array[SIZEARRAY];
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue