Thread: Fortran 90 to C Conversion

  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    1

    Smile Fortran 90 to C Conversion

    I am new to C Language and need to convert the following line of code from fortran90 to C. Any help will be highly appreciated.

    INQUIRE(File=filename, OPENED = op,EXIST = ex, ACCESS=ac, NUMBER= unit_no)

    where
    EXIST=lex ! true or false
    OPENED=lod ! true or false
    NAME=fnm ! filename
    ACCESS=acc ! 'DIRECT' or 'SEQUENTIAL'
    NUMBER=unum ! unit number

  2. #2
    Registered User
    Join Date
    Jan 2007
    Location
    Euless, TX
    Posts
    144
    First, you'll need to read up on FILE handling in C. I don't think there are any applicable C library routines that do anyhting like an "INQUIRE". The closest might be "ftell" or "fseek", which are functions to use for finding and setting file position markers. It depends on what your Fortran function "INQUIRE" is really performing. In any event, you need to read all about C input/output if you are going to work with file open/close/read/write type operations. Google and you should be able to find what you need.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. real-world apps in C++ (preferably simple)?
    By Aisthesis in forum C++ Programming
    Replies: 13
    Last Post: 06-12-2009, 01:03 PM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Header File Question(s)
    By AQWst in forum C++ Programming
    Replies: 10
    Last Post: 12-23-2004, 11:31 PM
  5. HUGE fps jump
    By DavidP in forum Game Programming
    Replies: 23
    Last Post: 07-01-2004, 10:36 AM