henkel%nepjt@ncsuvx.ncsu.edu (Chuck Henkel) (06/22/91)
I'm trying to write a Fortran wrapper around the C "getenv" routine, and need to pass character data between Fortran and C. I had in mind something like this: character*40 var, value var = 'USER'//char(0) call getenval (var, value) write (*,*) 'Value = ', value end With: #include <stdlib.h> #include <strings.h> void getenval (char *ename, char *evalue) { strcpy(evalue,getenv(ename)); return; } But, of course it doesn't work. - I tried putting %REF()s around the arguments in the getenval call. - Info talks about a builtin version of getenv for fortran, but it doesn't have the same functionality as C getenv. -- | Chuck Henkel | There are currently 111 operating | | Department of Nuclear Engineering | nuclear power plants in the US, | | N.C. State University | generating nearly 100,000 Megawatts | | henkel%nepjt@ncsuvx.ncsu.edu | of electricity. |