HP SunSoft Pascal 4.0 Uživatelský manuál Strana 176

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 333
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 175
152 Pascal 4.0 Users Guide
7
Function Return Values
Function return values match types in the same manner as with parameters.
They pass in much the same way.
The C++ main program,
SimValMain.cc
#include <stdio.h>
extern "C" void SimVal(
char,
char,
char,
short,
int,
float,
double,
int &);
int main(void)
{
char t = 1, f = 0, c= 'z';
short si = 9;
int i=9;
float sr = 9.9;
double r =9.9;
int args;
SimVal (t, f, c, si, i, sr, r, args);
printf (" args = %07o \n", args);
return 0;
}
The commands to compile and
execute SimVal.p and
SimVal.cc
hostname% pc -c SimVal.p
hostname% CC SimVal.o SimValMain.cc -lpc
hostname% a.out
args = 111111
Zobrazit stránku 175
1 2 ... 171 172 173 174 175 176 177 178 179 180 181 ... 332 333

Komentáře k této Příručce

Žádné komentáře