HP SunSoft Pascal 4.0 User Manual Page 185

  • Download
  • Add to my manuals
  • Print
  • Page
    / 333
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 184
The C++–Pascal Interface 161
7
Global Variables in C++ and Pascal
If the types are compatible, a global variable can be shared between C++ and
Pascal. See this example:
The Pascal procedure,
GloVar.p
var
Year: integer;
procedure GloVar;
begin
Year := 1995;
end;
The C++ main program,
GloVarMain.cc
#include <stdio.h>
extern "C" void GloVar ();
int Year;
int main(void)
{
Year = 2042;
GloVar ();
printf (" %d \n", Year);
}
The commands to compile and
execute GloVar.p and
GloVarMain.cc
hostname% pc -c GloVar.p
hostname% CC GloVar.o GloVarMain.cc -lpc
hostname% a.out
1995
Page view 184
1 2 ... 180 181 182 183 184 185 186 187 188 189 190 ... 332 333

Comments to this Manuals

No comments

Lensbaby Composer Pro w/ Sweet 50 manuels

Manuels d'utilisation et guides de l'utilisateur pour Objectifs d'appareil photo Lensbaby Composer Pro w/ Sweet 50.
Nous fournissons des manuels en pdf 1 Lensbaby Composer Pro w/ Sweet 50 à télécharger gratuitement par type de document : Manuel de l'utilisateur


Table des matières





Plus de produits et de manuels pour Objectifs d'appareil photo Lensbaby

Modèles Type de document
SPARK Manuel de l'utilisateur   Lensbaby Spark, 2 pages