Re: Short records on unformatted reads
- From: Gary Scott <garylscott@xxxxxxxxxxxxx>
- Date: Sun, 29 Oct 2006 20:52:01 GMT
Thomas Koenig wrote:
What should the following program print?print statement prints 1 and 97 with CVF
program main
implicit none
integer, dimension(2) :: ia
open(10, form="unformatted", status="unknown")
write (10) 1, 'a'
rewind 10
ia = 42
read (10, err=20) ia
20 continue
print '(2I8)', ia
end program main
Is the first number printed required to be 1?
Is the processor free to print garbage as the second number?
--
Gary Scott
mailto:garylscott@sbcglobal dot net
Fortran Library: http://www.fortranlib.com
Support the Original G95 Project: http://www.g95.org
-OR-
Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html
Why are there two? God only knows.
If you want to do the impossible, don't hire an expert because he knows it can't be done.
-- Henry Ford
.
- References:
- Short records on unformatted reads
- From: Thomas Koenig
- Short records on unformatted reads
- Prev by Date: Re: READ-statement and a segmentation fault
- Next by Date: Re: Short records on unformatted reads
- Previous by thread: Re: Short records on unformatted reads
- Next by thread: Re: Short records on unformatted reads
- Index(es):
Relevant Pages
|
|