/*---------------------------------------------------------------------+
| Copyright (c) 1995, SAS Institute Inc. |
| Unpublished - All Rights Reserved |
| S A S / C S A M P L E |
| |
| |
| NAME: CTOCXX1 |
| LANGUAGE: C |
| PURPOSE: Call a C++ function from a C main(). Then, call a C |
| function from a C++ function. |
| MVS - |
| COMPILE: Use AUX(CTOCXX). Compiled using LC370C for C, LCXX |
| for C++. |
| LINK: Use AUX(CTOCXX). Linked using LCXXL. |
| EXECUTE: Use AUX(CTOCXX). Call <prefix>.LOAD(CTOCXX). |
| NOTES: |
| TSO - |
| COMPILE: Compile using LC370C for C, LCXX for C++. |
| LINK: Link the C and C++ object modules using CLK370 with |
| "CXX" option. |
| EXECUTE: Call <prefix>.LOAD(CTOCXX). |
| NOTES: |
| CMS - |
| COMPILE: Compile using LC370C for C, LCXX for C++. |
| LINK: Link the C and C++ object modules using CLINK with |
| "CXX" and "GENMOD" options. |
| EXECUTE: Call CTOCXX. |
| NOTES: |
| MISC NOTES: This example consists of 2 modules. CTOCXX1 is the C |
| source module. CTOCXX2 is the C++ source module. |
| |
+---------------------------------------------------------------------*/
#include <stdio.h>
extern gotocxx(); /* the C++ function called from C */
void main() /* a C main() */
{
printf("Starting in C main()\n");
printf("Call a C++ function\n");
gotocxx();
printf("Leaving the C main()\n");
}
void callc() /* a C function */
{
printf("This is C function callc()\n" );
printf("Returning to C++\n" );
}