I would like to convert a int32_t from host byte order to network byte order and vice versa. I know about the htonl() function and its variants, but this takes unsigned ...
for example, i want to get an array of 4 ints from child to parent. parent calls
read(apipe, buf, sizeof(int)*4);
for(int i=0; i<4;i++)
write(bpipe, &array[i], sizeof(int));
ungetc is only guaranteed to take one byte of pushback. On the other hand, I've tested it on Windows and Linux and it seems to work with two bytes.
Are there any ...