ähm, eines verstehe ich nicht:
uint32_t inet_a2n(uint8_t a, uint8_t b, uint8_t c, uint8_t d){
uint8_t octs[4] = {a,b,c,d};
return *(uint32_t*)octs;
}
int main(){
printf("%d\n", inet_a2n(1,1,168,192)); // -1062731519
..
Wie kann das negativ werden? Ich hab doch ausdrücklich unsigned angewiesen. Und ansonsten sind alle Typen stimmig.
MfG