Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Calling C function from FORTRAN on Alpha
@ 1995-07-05  4:00 Ron Behee
  1995-07-06  4:00 `  Achille Hui, the Day Dreamer 
  0 siblings, 1 reply; 2+ messages in thread
From: Ron Behee @ 1995-07-05  4:00 UTC (permalink / raw)


I need to call a small c function from FORTRAN.  I just need to pass a integer 
back.  Does anyone know where I can find a sample problem doing this???




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Calling C function from FORTRAN on Alpha
  1995-07-05  4:00 Calling C function from FORTRAN on Alpha Ron Behee
@ 1995-07-06  4:00 `  Achille Hui, the Day Dreamer 
  0 siblings, 0 replies; 2+ messages in thread
From:  Achille Hui, the Day Dreamer  @ 1995-07-06  4:00 UTC (permalink / raw)


+---In <sinda.3.01DEF440@indirect.com>---
|   sinda@indirect.com (Ron Behee) writes...
+---------
| I need to call a small c function from FORTRAN.  I just need to pass a i...
| back.  Does anyone know where I can find a sample problem doing this???
| 

Following works on a DEC 3000/600 running OSF/1 2.0:

# cat a_f.f
      program test
      external a
      integer*4 i
      i = 2
      call a(i)
      write(6,*) i
      stop
      end
# cat a_c.c
void a_(int *i){
	*i = 1;
}
# cc  -c a_c.c
# f77 -o a.out a_f.c a_c.o
# a.out
           1




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1995-07-06  4:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-07-05  4:00 Calling C function from FORTRAN on Alpha Ron Behee
1995-07-06  4:00 `  Achille Hui, the Day Dreamer 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox