Anyone used getcwd in F90 program?

November 6, 2020 at 09:50:41
Specs: Windows 10
Has anyone used the C Runtime Library routine getcwd in a Fortran90 program? If so, exactly how is it used? All I get is either blanks or a violation.

See More: Anyone used getcwd in F90 program?

November 8, 2020 at 01:31:52
Fortran and C define strings differently, which may be your problem. Have a look at:

Or, if you are using gcc, you could just use the Fortran GETCWD function:

Reply ↓  Report •

November 8, 2020 at 05:04:17
The examples given are calling Fortran from C. I am calling a C routine from Fortran. This C routine is in the C Runtime Library on an Alpha running OpenVMS 8.4. The Fortran90 compiler is version 8.2. The online help says getcwd has 2 arguments: the 1st is a pointer to the variable which will hold the default directory string and the 2nd is the length of the returned default directory string.

Reply ↓  Report •
Related Solutions

Ask Question