Mail Archives: djgpp/1999/05/19/06:34:29
> The second point I had for Eugene is that we already solved his
> original problem long ago as he proposed the above solution to
> be added our library. Our solution, as you might have guess,
> uses any type, not EXACTLY 2 bytes, but AT LEAST two bytes,
> and then use routines such as:
>
> WriteIntegerToFile(file,value,bytes)
> ReadIntegerFromFile(file,*value,bytes)
>
> This inputs/outputs the integer byte by byte, using the number
> of bytes given the last parameter.
But now nobody can get to COMMON decision what type should have
variable value in above definition.
I had required it to be unsigned long, to accept either short int,
int, and long int.
Other words all family of int (and we do nto work with negative
numbers)
But our programmers do mind about it. One said that int is better
because the problems of pointer conversion in ReadIntegerFromFile will
arise.
(Formerly we had following function, which is not supported errors)
int ReadIntegerFromFile (file, bytes)
And it was proposed to change it to the above quoted definition.
I have proposed to use following code to avoid problems (supposed
that: int x;)
> > > > > usinged long y;
> > > > > if (ReadIntegerFromFile(f,&y,bytes)!=bytes) Exit_me();
> > > > > x = y;
Could you advise me now, which type should be *value in the
ReadIntegerFromFile functions as above?
I need compatibility with 16-bit systems and ANSI (so please do not
propose me long long int definition)
Eugene
- Raw text -