Mail Archives: djgpp/1996/11/22/18:13:13
I have a slight problem with libc.a's read() function. When I execute
the following code:
---
#include <all header files required>
main()
{
int File = open(Filename, O_RDONLY);
char Buffer[20] = read(File, Buffer, 19);
puts(Buffer);
close(File);
return 0;
}
-- // compiled with 'gcc file.cpp'
It does everything right, but the output is like this:
--
DJGPP is the bestt
--
For some reason there is an extra 't' in the example. When I read a
lot of characters (say 80 or so), there are 3 extra characters!! What
am I doing wrong here??
Thx Gorman
- Raw text -