Jump to content

Welcome to DosHacks
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!


Compatibility of C and C++

  • Please log in to reply
No replies to this topic




    • Administrators
    • Posts27
    • Warn level0
    • Reputation25

Compatibility of C and C++


To give compiler sellers unique opportunity the C++ gauges board chose not to manage the execution of name disfiguring exemption taking care of and other usage definite highlights.The drawback of this choice is that object code created by various compilers is relied upon to be inconsistent.There were be that as it may endeavors to institutionalize compilers for specific machines or working frameworks (for example C++ ABI) however they appear to be to a great extent deserted at this point. 
With C:
Additional information: Compatibility of C and C++
C++ is frequently viewed as a superset of C however this isn\'t entirely valid.Most C code can without much of a stretch be made to aggregate effectively in C++ however there are a couple of contrasts that reason some substantial C code to be invalid or carry on distinctively in C++.For example C permits understood change from 
. to other pointer types yet C++ does not (for sort wellbeing reasons).Likewise C++ characterizes numerous new catchphrases for example 
. which might be utilized as identifiers (for example variable names). in a C program. 
A few contrary qualities have been evacuated by the 1999 update of the C standard (C99) which presently bolsters C++ highlights for example line comments
and presentations blended with code.Then again C99 presented various new highlights that C++ did not support that were contradictory or repetitive in C++ for example variable-length clusters local complex-number sorts (nonetheless the
 class in the C++ standard library gives comparable usefulness despite the fact that not code-good) assigned initializers compound literals and the 
keyword.A portion of the C99-presented highlights was incorporated into the following form of the C++ standard C++11 (out of those which were not repetitive).Be that as it may the C++11 standard presents new contrary qualities for example forbidding task of a string strict to a character pointer which stays solid C. 
To intermix C and C++ code any capacity statement or definition that will be called from/utilized both in C and C++ must be pronounced with C linkage by setting it inside an
extern C {/*..*/}
 square.Such capacity may not depend on highlights relying upon name ravaging.

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users