I have this simple code, in Genie syntax:
init
var f = FileStream.open(/tmp/0setup-raw-db,r)
var a = new array of char[2048]
while f.eof() != true
f.gets(a) /*read one line from file*/
a[a.length - 1] = 0 /*make it
Hello,
Attention, the function feof (in C) should not be used to check the end of a
file: http://c-faq.com/stdio/feof.html
The correct code:
[indent=2]
init
var f = FileStream.open(./main.gs,r)
var a = new array of char[2048]
while (f.gets(a) != null)
a[a.length - 1] = 0 /*make
On Sat, 2009-03-21 at 00:27 +0100, Nicolas Joseph wrote:
Hello,
Attention, the function feof (in C) should not be used to check the
end of a file: http://c-faq.com/stdio/feof.html
The correct code:
[indent=2]
init
var f = FileStream.open(./main.gs,r)
var a = new array of