Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fortran read statement 2

Status
Not open for further replies.

nouraaa

Programmer
Apr 12, 2013
5
i didn't get what does read statement do in this case?:

int x
read(textpart(2*i-1),'(f20.0)',iostat=istat) x

textprat is an array of char*
istat is an integer

anyone could help please?
 
the first parameter shouldn't be an integer???
 
have you read the documentation for "READ"? It should all be explained there.

Basically, the first argument is the place you read from...be it a unit number (file) or a character string.

The second argument is the format you expect the data to be in. Typically, it is best to stay away from any specific format and simply read in a 'list directed' fashion.

The iostat flag sets the variable you pass to give you feedback on the exit status of the READ operation.

The 'x' following the "READ(...)" is the variable whose value you are trying to read.
 
someone could recommend a good documentation for FORTRAN, it's my first experience with this language and i didn't find anything interesting (or i'm not a good searcher) .
thanks.
 
refer to th elast post of this thread:

Link

Norbert


The optimist believes we live in the best of all possible worlds - the pessimist fears this might be true.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top