Re: Can Fortran Use This C Variable Directly Via "external" Decl?
- From: "apm" <Contributor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 29 Sep 2005 09:37:23 -0400
The EXTERNAL in Fortran corresponds to a function in C. That is,
EXTERNAL i4add
! define I and J
....
CALL i4add(I, J)
may call
long i4add_(i,j)
int *i, *j;
{
long k;
k = *i * *j;
return(k);
}
Example from Lahey/Fujitsu.
<clusardi2k@xxxxxxx> wrote in message
news:1127931881.301737.189560@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hello,
>
> I'm pretty sure this is impossible, but someone suggested it to
> me.
>
> Can I do this with the f77 compiler:
>
> /** main.C **/
>
> int try_it;
>
> int test_ ()
> {
> }
>
> CCC test.F CCC
> program main
> external try_it
> try_it = 100
> stop
> end
>
> Thanks anyway,
> Christopher Lusardi
>
> P.S.: I know how to do it via common, structs.
>
.
- References:
- Can Fortran Use This C Variable Directly Via "external" Decl?
- From: clusardi2k
- Can Fortran Use This C Variable Directly Via "external" Decl?
- Prev by Date: Re: Does this string processing work for you?
- Next by Date: Re: NEWBIE QUESTION
- Previous by thread: Re: Can Fortran Use This C Variable Directly Via "external" Decl?
- Next by thread: BSTR and Allocatable arrays
- Index(es):
Relevant Pages
|
|