I have written this little function:
int mayor(int n1, int n2, int n3, int n4, int n5) {
int mayor = n1;
for(int *p=&n2; p<=&n5; ++p)
mayor = *p;
return mayor;
}
Is it guaranteed that the memory block that contains n1
to n5
is contiguous? Since I get the expected return value I hope so, but I want to know whether this is safe.