I'm using the write() function something like this:
write(fildes, write_value, sizeof(n));
ie. I want to write a single integer value to filedes file. The integer is successfully written, but there is always a garbage value like t^@^@ appended to the end and I cannot understand why... by my (admittedly not rock solid) logic, only the correct number of bytes for an int should be written...
If someone could clue me in on the reason this happens, I should hopefully be able to fix it...
thanks