Re: Can Fortran Use This C Variable Directly Via "external" Decl?



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


.



Relevant Pages