saalek
مدیر بازنشسته
از كتاب هربرت شيلد:
لينك در تاپيكهاي كتابها موجود است.
C vs. C++
Before concluding this chapter, a few words about C++ are in order. Newcomers are sometimes
confused about what C++ is and how it differs from C. In short, C++ is an object-oriented
programming language that was built upon the foundation of C. In general terms, C is a subset of
C++, or conversely, C++ is a superset of C.
In general, you can use a C++ compiler to compile a C program. In fact, today most compilers
handle both C and C++ programs. Thus, most programmers will use a C++ compiler to compile
their C code! However, since C++ was built upon the 1989 C standard, you must restrict your C
code to the features defined by that standard (which are the features described in Part One of this
book).
There is one thing that you must be careful about when using a C++ compiler to compile a C
program: the file extension. By convention, C programs use the .C extension. C++ programs
use .CPP. Don't accidentally give your C program a .CPP extension. Differences between the two
languages might prevent a valid C program from being compiled as if it were a C++ program. By
specifying the .C extension, you are telling the C++ compiler to perform a ''C compile."
به طور خلاصه ، سي++ يك زبان شي گراست كه بر اساس سي ساخته شده.
به طور كلي سي ، زيرمجموعه اي از سي++ است و سي++ مافوق سي است.
در كل،شما مي توانيد يك كامپايلر سي++ را براي كامپايل يك برنامه سي بكار بريد.
در حقيقت امروزه بيشتر كامپايلرها ، هم سي و هم سي++ را تحت پوشش قرار مي دهند. بنابراين بيشتر برنامه نويس ها يك كامپايلرسي++ بكار مي برند براي كامپايل برنامه هاي سي.
چون سي++ بر اساس سي استاندارد (1989) ساخته شد، شما بايستي كدهاي سي خود را با آن استاندارد هماهنگ كنيد.(در فصل 1 كتاب شرح داده شده.)
هنگامي كه داريد يك برنامه سي را با كامپايلر سي++ كامپايل مي كنيد بايد به يك نكته توجه داشته باشيد:
پسوند فايل سي دات سي .c است و سي++ ، دات سي پي پي .cpp
با دادن پسوند شما داريد به كامپايلر مي گوييد كه چه نوع برنامه اي مدنظر داريد . سي ، يا سي++.
لينك در تاپيكهاي كتابها موجود است.
C vs. C++
Before concluding this chapter, a few words about C++ are in order. Newcomers are sometimes
confused about what C++ is and how it differs from C. In short, C++ is an object-oriented
programming language that was built upon the foundation of C. In general terms, C is a subset of
C++, or conversely, C++ is a superset of C.
In general, you can use a C++ compiler to compile a C program. In fact, today most compilers
handle both C and C++ programs. Thus, most programmers will use a C++ compiler to compile
their C code! However, since C++ was built upon the 1989 C standard, you must restrict your C
code to the features defined by that standard (which are the features described in Part One of this
book).
There is one thing that you must be careful about when using a C++ compiler to compile a C
program: the file extension. By convention, C programs use the .C extension. C++ programs
use .CPP. Don't accidentally give your C program a .CPP extension. Differences between the two
languages might prevent a valid C program from being compiled as if it were a C++ program. By
specifying the .C extension, you are telling the C++ compiler to perform a ''C compile."
به طور خلاصه ، سي++ يك زبان شي گراست كه بر اساس سي ساخته شده.
به طور كلي سي ، زيرمجموعه اي از سي++ است و سي++ مافوق سي است.
در كل،شما مي توانيد يك كامپايلر سي++ را براي كامپايل يك برنامه سي بكار بريد.
در حقيقت امروزه بيشتر كامپايلرها ، هم سي و هم سي++ را تحت پوشش قرار مي دهند. بنابراين بيشتر برنامه نويس ها يك كامپايلرسي++ بكار مي برند براي كامپايل برنامه هاي سي.
چون سي++ بر اساس سي استاندارد (1989) ساخته شد، شما بايستي كدهاي سي خود را با آن استاندارد هماهنگ كنيد.(در فصل 1 كتاب شرح داده شده.)
هنگامي كه داريد يك برنامه سي را با كامپايلر سي++ كامپايل مي كنيد بايد به يك نكته توجه داشته باشيد:
پسوند فايل سي دات سي .c است و سي++ ، دات سي پي پي .cpp
با دادن پسوند شما داريد به كامپايلر مي گوييد كه چه نوع برنامه اي مدنظر داريد . سي ، يا سي++.