Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Problems and restrictions

&pagelevel(4)&pagelevel

The combined usage of C and C++ in a program system is subject to the following restrictions:

  • Free store management

    The new and delete operators in C++ provide a separate facility for free store management. Storage space management in C, by contrast, is achieved by the functions malloc and free. These two methods must not be combined.

    The effect of using delete to free storage that was requested with malloc (or using free on storage that was requested with new) is undefined.

  • Standard I/O files

    C++ offers a new interface for file processing. The C++ standard files cin, cout, cerr and clog correspond to the standard I/O files stdin, stdout and stderr in C.

    Note that if the corresponding standard files are used in both C and C++, the behavior of the program cannot be guaranteed.

    If the standard I/O files for C and C++ are to be used in combination in the same C++ program, the C++ function ios::sync_with_stdio()must be called (see the manual “C++ Library Functions” [5]).