Professional Documents
Culture Documents
Q2ap2 Lab
Q2ap2 Lab
h>
#include <stdlib.h>
#include <time.h>
typedef struct {
unsigned int n1:8;
unsigned int n2:8;
unsigned int n3:8;
unsigned int n4:8;
} IP;
void printPI(IP x) {
printf("%d.%d.%d.%d\n", x.n1, x.n2, x.n3, x.n4);
}
x->n1 = n[0];
x->n2 = n[1];
x->n3 = n[2];
x->n4 = n[3];
}
int main() {
srand(time(NULL));
IP demonstracao;
printf("demonstração: %ld\n\n", sizeof(demonstracao));
IP vetor[30];