Re: confused abt file operations



siliconwafer wrote:
> Hi Again,
> So what about numbers wirtten to /read from the text/binary files?

If you're replying to something specific, please include the context
of what you are replying to.

> I read that in text files numbers are stored as characters or
> strings rather than their actual values. So a number 1234 will
> occoupy 5 bytes(4 + ' \0 ' ).In binary files,numbers are stored
> as actual values i.e 1234 is stored as 2 bytes integer and so
> on.. was the book correct?

With text files, you can only output 'printable' characters. With
binary files you can output whatever byte values you want.

How you encode your integer as output is up to you. For instance,
you can print the number 42 as "42", or "2A" if you want to output
hexadecimal.

Because binary streams are not limited to printable characters
alone, you have an additional option of copying the integer
representation itself.

--
Peter

.



Relevant Pages

  • Re: More evidence of weak security at GA airports
    ... It's good that you're now quoting the post you're replying to, ... is to use '>' characters in the left margin, one for each level of embedded ... If you use any standard news reader (whether standalone or ...
    (rec.aviation.piloting)
  • Re: Problem using Replace function with Memo field
    ... Thanks for replying. ... whenever I attempt in code to change the field value of a memo field that ... Fields that are 2036 characters or less work fine. ... Here is a reprensentation of the actual code: ...
    (microsoft.public.access.modulesdaovba)
  • Re: Truncate file
    ... characters - and call FileStream.SetLength. ... Jon Skeet - ... If replying to the group, please do not mail me too ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: X-Face
    ... > Oh, by the way, the post you're replying was using ... Didn't hurt too much, did it? ... characters in the post. ...
    (news.software.readers)