HP SunSoft Pascal 4.0 Manual do Utilizador Página 157

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 333
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 156
The C–Pascal Interface 133
6
functions can be passed to other languages as arguments, the static links for all
procedure or function arguments are placed after the end of the conformant
array bounds pairs, if any.
Routines in other languages can be passed to Pascal; a dummy argument must
be passed in the position normally occupied by the passed routine’s static link.
If the passed routine is not a Pascal routine, the argument is used only as a
placeholder.
Global Variables in C and Pascal
If the types are compatible, a global variable can be shared between C and
Pascal.
An example:
The Pascal procedure,
GloVar.p
var
Year: integer;
procedure GloVar;
begin
Year := 2001
end; { GloVar }
The C main program,
GloVarMain.c
#include <stdio.h>
extern void GloVar();
int Year;
int main(void)
{
Year = 2042;
GloVar();
printf( " %d \n", Year ) ;
}
Vista de página 156
1 2 ... 152 153 154 155 156 157 158 159 160 161 162 ... 332 333

Comentários a estes Manuais

Sem comentários