ILE C/C++ Programmer's Guide

Differences in Linkage Specification

The figures in this section illustrate differences in linkage specification in ILE C and ILE C++. The same function is performed in the source code found in Figure 209, Figure 210, and Figure 211.

C language only

Figure 209. Example of ILE C Source Code Using the extern Linkage Specification



Module1.c

extern void foo (int *i, char **s)
{
*s = *i ? "Not Zero" : "Zero";
}

C language only

Figure 210. Example of ILE C Source Code Using the #pragma argument Linkage Specification



Module2.c

extern void foo (int, char *);

#pragma argument (foo, VREF)

int main()

{
char *s;
foo (1, s);
}

C++ language only

Figure 211. Example of ILE C++ Source Code Using the extern Linkage Specification



Module3.C

extern "VREF" void foo (int i, char *s)
{
s = i ? "Not Zero" : "Zero";
}

int main()
{
char *s;
foo (1, s);
}


[ Top of Page | Previous Page | Next Page | Table of Contents ]