PSS ID Number: 148203
Article Last Modified on 11/4/1999
C Fortran Main Source Code
C Compile options needed: none
INTERFACE
SUBROUTINE MYFUNC(I)
INTEGER I
!MS$ATTRIBUTES VALUE :: I
!MS$ATTRIBUTES C,ALIAS:'_myfunc' :: myfunc
END SUBROUTINE MYFUNC
END INTERFACE
CHARACTER STR*3, TEMP*4
INTEGER L
STR = 'ABC'
L = 3
C this fails
CALL MYFUNC(LOC(STR(1:L)//CHAR(0)))
C these work
CALL MYFUNC(LOC(STR//CHAR(0)))
CALL MYFUNC(LOC(STR(1:3)//CHAR(0)))
TEMP=STR(1:L)//CHAR(0)
CALL MYFUNC(LOC(TEMP))
END
------------
/* C Function Source Code:
Compile options needed: /c
*/
#include <stdio.h>
void myfunc(char *s)
{
long x;
x = (long) s;
printf("s: %x String: %s\n", x, s);
}
s: 12ffa8 String: -
s: 12ffa4 String: ABC
s: 12ffa0 String: ABC
s: 41bac8 String: ABC
Additional query words: 4.00
Keywords: kbLangFortran KB148203
Technology: kbAudDeveloper kbFORTRANPower400NT kbFortranSearch kbZNotKeyword8