Y
Yin Zhu
Hello, All
Maybe this question is not proper to post here but anyway would
someone help me?
I am doing my operating system homework. I know how to use a buffer
string to do read and write.
But how about 32-bit int?
Here is my method to do:
typedef unsigned char *byte_pointer;
write(fd, (byte_pointer)&i, sizeof(int));
read(fd, (byte_pointer)&j, sizeof(int));
it works.
I don't know whether my method is a common way. or there's some other
ways to do it.
thanks in advance.
Maybe this question is not proper to post here but anyway would
someone help me?
I am doing my operating system homework. I know how to use a buffer
string to do read and write.
But how about 32-bit int?
Here is my method to do:
typedef unsigned char *byte_pointer;
write(fd, (byte_pointer)&i, sizeof(int));
read(fd, (byte_pointer)&j, sizeof(int));
it works.
I don't know whether my method is a common way. or there's some other
ways to do it.
thanks in advance.