Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: eillihca@drizzle.StanFord.EDU ( Achille Hui, the Day Dreamer )
Subject: Re: Calling C function from FORTRAN on Alpha
Date: 1995/07/06	[thread overview]
Message-ID: <eillihca.95070521125326903@drizzle.Stanford.EDU> (raw)
In-Reply-To: sinda.3.01DEF440@indirect.com

+---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




      reply	other threads:[~1995-07-06  4:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]
read-only archive

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