1.At output1, why there are 30 * '\0' after j
Not 30, but almost 04000. od
truncated the output because it was huge and repetitive. Why are there zeroes? Because you told your program to insert them. lseek()
padded the file.
why file ends with 0004012 not 0004010
It doesn't - it's again od
prints addresses in octal, not in hexadecimal (as you may have expected).