C and C++ Language

Some High-Level Languages 

Kameshwar


C and C++ c language was developed in 1972 at AT&T's Bell laboratories, USA by Dennis Ritchie and Brian Kernighan.
      Their objective was to develop a language having the virtues of high-level programming languages (mainly machine independence) with the efficiency of assembly languages.C language was designed to meet th objective by having following features: It was developed as a compiled language
    (uses compiler as its translator) so that C language programs could be ported easily to other computers having a C compiler One major feature of C language isa special data type called pointer It allows a reference type variable to be created for any data type, It reduces the need to keep multiple copies of the same data in memory and essentially allows direct memory manipulation,
       This feature allows programmers to access memory addresses directlywhere variables are stored, and to perform bit-level manipulation of data stored in memory or processor registers.

3. It supports user-defined data types for greater flexibility in programming.

4. It supports modular and structured programming concepts.That is, while writing a C program to solve a problem, the problem may be broken down into smaller tasks, a function may be written (or used) to solve each task, and the C program may become a group of functions linked together toproduce the problem solution.It also supports a rich library of functions used directly by programmers fo efficient coding of their applications, 

5. It is a small and concise language providing only essential features so that a C language program ca be translated by a language translator into an eficient machine language code.

Due to these features, c soon became the language of choice of systems programmers who wanted to wri ortable systems software and commercial software packages like operating systems, compilers, spreadshee ord processing, and database management systems.In fact, the first major use of C was to write the UNIX operating system.

Today, C is used extensively by all types of programmers for programming various types to learn and flexible use of pointers very powerful language, they also make Ca difficult offered and comprehend.

 programmers often find it difficult to understand and use to be by pointers in programming a solution. Moreover, its conciseness allows highly compact written for carrying out complex computations. ten, such programs are difficult to understand particularly when they make extensive use of pointers years after its development, the only standard for c was a book on by its developers and Ritchie.

Using notations and techniques described by them is often referred to as K&R C style. standard for C was produced in 1989. new version of named (pronounced by Bjarne Stroustrup at Bell Labs in the early 1980s. The evolution of C++ continued during the and the first widely available implementation appeared in 1985.

C++ is so called because in C, which increments a numeric variable's value by 1. Therefore, Clanguage is incremented to its C++ all the elements of the basic C language but has been expanded to include numerous object-oriented features. The most essential part of support for object-oriented programming is the class/object that is the central feature of C++. C++ provides a collection of predefined classes along with to define and use user-defined classes.

to being a superset of C is an extremely powerful and efficient language. However, C++ may be more difficult learn means learning everything about Cand then learning object-oriented design C++ and its implementation with C++. Thus, it is advisable to understand Object oriented Programming lays concepts first, and then learn its implementation in C++. One important thing to remember is that where C++ emphasis on user data type (UD) and its structured use, ooP lays emphasis on data and its abstraction, encapsulation, and inheritance modeling leading to use by interaction between them. Since, OOP is near to real life modeling of data and its interaction, it is more natural way of programming. C++ is one of the most popular ways of implementing OOP over the years,

C++ has become a very popular language and more Cprogrammers are migrating to C++ Another factor in favor of the future popularity of C++ is that it is almost completely downward compatible with C (meaning that C programs can be, for the most part, compiled as C++ programs). and in most implementations it is possible to link C++ code with C code. Figure 12.16 shows a c language program to compute and print the sum of 10 numbers.

The first few lines of the program are comment statements. Any comment can be placed within the symbols and Then the two #include statements are directives to the compiler to include standard library and standard input-output header files in the program before compiling the program. Then the main function of the program starts. Every C program must have a main() function, and all C programs can have only one main() function.

The word vo placed prior to the main function indicates that the function does not return a value. The next two statements declare the data types of the variables used in the program. Sum and Nare declared as float so that they can accept fractional numbers, whereas Count is declared as integer because it needs to be assigned integer values only. In these two statements, their values are also initialized to zero. The next statement starts a "for" loop that accepts and computes the sum of the 10 numbers. Finally, the printf statement prints the result of computation.
A simple C/C++ program

कुछ उच्च-स्तरीय भाषाएँ 

सी और सी ++ सी भाषा 1 9 72 में एटी एंड टी की बेल प्रयोगशालाओं में विकसित की गई थी, जो कि अमेरिका में डेनिस रिची और ब्रायन केरिंगन ने विकसित किया था। उनका उद्देश्य विधानसभा भाषाओं की दक्षता के साथ उच्च स्तरीय प्रोग्रामिंग भाषाओं (मुख्य रूप से मशीन आजादी) के गुण वाले भाषा को विकसित करना था सी भाषा निम्नलिखित सुविधाओं के द्वारा वें उद्देश्य को पूरा करने के लिए डिज़ाइन की गई थी: इसे संकलित भाषा के रूप में विकसित किया गया था (कंपाइलर को इसके अनुवादक के रूप में प्रयोग किया जाता है) ताकि सी भाषा प्रोग्राम सी कंपाइलर वाले अन्य कंप्यूटरों में आसानी से रखे जा सकें। सी भाषा का एक प्रमुख विशेषता है पॉइंटर नामक एक विशेष डेटा प्रकार यह किसी संदर्भ प्रकार चर को किसी भी डेटा प्रकार के लिए बनाने की अनुमति देता है, यह स्मृति में समान डेटा की एक से अधिक प्रतियां रखने की आवश्यकता को कम करता है और मूलतः मेमोरी मेहनण की अनुमति देता है, यह सुविधा प्रोग्रामर को सीधे मेमोरी पतों को एक्सेस करने की अनुमति देता है जहां चर संग्रहीत हैं, और मेमोरी या प्रोसेसर रजिस्टरों में संग्रहीत डेटा के बिट-स्तर हेरफेर करने के लिए।

 3. प्रोग्रामिंग में अधिक लचीलेपन के लिए उपयोगकर्ता-निर्धारित डेटा प्रकारों का समर्थन करता है।
 4. यह मॉड्यूलर और संरचित प्रोग्रामिंग अवधारणाओं का समर्थन करता है। एक समस्या को हल करने के लिए सी प्रोग्राम लिखते समय, समस्या को छोटे कार्यों में विभाजित किया जा सकता है, प्रत्येक कार्य को हल करने के लिए एक फ़ंक्शन (या प्रयोग किया जाता है) लिखा जा सकता है, और सी प्रोग्राम एक साथ जुड़े कार्यों का एक समूह बन सकता है समस्या समाधान का उत्पादन यह अपने अनुप्रयोगों के कुशल कोडिंग के लिए प्रोग्रामर द्वारा प्रत्यक्ष रूप से उपयोग किए जाने वाले फ़ंक्शन के समृद्ध लाइब्रेरी का भी समर्थन करता है।

5. यह एक छोटी और संक्षिप्त भाषा है जो केवल आवश्यक विशेषताओं को प्रदान करती है ताकि सी भाषा कार्यक्रम का अनुवाद भाषा अनुवादक द्वारा एक उग्र मशीन भाषा में अनुवाद किया जा सके कोड। इन सुविधाओं के लिए, सी सिस्टम प्रोग्रामर की पसंद की भाषा बन गई जो सिस्टम सिस्टम सॉफ्टवेयर और ऑपरेटिंग सिस्टम, कम्पाइलर, स्प्रेडशी ऑर्ड प्रसंस्करण और डेटाबेस प्रबंधन सिस्टम जैसे वाणिज्यिक सॉफ्टवेयर पैकेजों को बनाना चाहते थे। वास्तव में, सी का पहला बड़ा उपयोग यूएनआई को लिखना था

आज, सी विभिन्न प्रकार के प्रोग्राम्स के लिए बड़े पैमाने पर इस्तेमाल किया जाता है ताकि पॉइंटर्स के बहुत शक्तिशाली भाषा सीखने और लचीला उपयोग के लिए वे बहुत ही कठोर भाषा का उपयोग कर सकें। प्रोग्रामर को अक्सर समझना मुश्किल होता है और एक समाधान प्रोग्रामिंग में पॉइंटर्स द्वारा उपयोग किया जाता है। इसके अलावा, इसकी संक्षिप्तता जटिल कम्प्यूटेशंस ले जाने के लिए अत्यधिक कॉम्पैक्ट लिखे जाने की अनुमति देती है।

दस, ऐसे कार्यक्रमों को समझना मुश्किल है, विशेषकर जब वे इसके विकास के पश्चात वर्ष के बड़े पैमाने पर उपयोग करते हैं, तो सी के लिए एकमात्र मानक इसके डेवलपर्स और रिची द्वारा एक पुस्तक थी। उनके द्वारा वर्णित नोटेशन और तकनीकों का उपयोग अक्सर को के एंड आर सी शैली के रूप में जाना जाता है सी के लिए मानक 1 9 8 9 में उत्पादन किया गया था। 1 9 85 के शुरुआती दिनों में बेल लेबोरेट्स में बर्न स्टावस्ट्रुप द्वारा नामित नया संस्करण।

 सी ++ के विकास ने 1 9 85 में पहली बार व्यापक रूप से उपलब्ध कार्यान्वयन जारी रखा था। सी ++ को सी, जो 1 से एक संख्यात्मक चर का मान बढ़ाता है। इसलिए, मूल सी भाषा के सभी तत्वों को वर्गीकृत किया गया है, लेकिन कई ऑब्जेक्ट-उन्मुख सुविधाओं को शामिल करने के लिए विस्तारित किया गया है। ऑब्जेक्ट-ओरिएंटेड प्रोग्रामिंग के लिए समर्थन का सबसे अनिवार्य हिस्सा है क्लास / ऑब्जेक्ट जो सी ++ की केंद्रीय विशेषता है। C ++ उपयोगकर्ता परिभाषित क्लासेस को परिभाषित करने और उपयोग करने के लिए पूर्वनिर्धारित वर्गों का एक संग्रह प्रदान करता है।

सी का एक सुपरसेट होने के लिए एक अत्यंत शक्तिशाली और कुशल भाषा है। हालांकि, सी ++ अधिक कठिन सीखने का मतलब सीमेंट के बारे में सब कुछ सीखने के लिए हो सकता है ताकि ऑब्जेक्ट-ओरिएंटेड डिज़ाइन C ++ सीखने और सी ++ के साथ इसके कार्यान्वयन इस प्रकार, यह समझने की सलाह दी जाती है कि ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग पहले अवधारणाएं देता है, और उसके बाद सी ++ में इसका कार्यान्वयन सीखें याद रखने के लिए एक महत्वपूर्ण बात यह है कि जहां उपयोगकर्ता डेटा प्रकार (यूडी) और इसकी संरचित उपयोग पर सी ++ जोर दिया जाता है, ओओपी आंकड़ों पर जोर देता है और इसके अमूर्त, इनकैप्सुलेशन, और उत्तरार्द्ध मॉडलिंग उन दोनों के बीच संवाद द्वारा उपयोग करने के लिए अग्रणी है। चूंकि,

OOP डेटा के असली जीवन मॉडलिंग के निकट और इसकी बातचीत है, यह प्रोग्रामिंग का अधिक स्वाभाविक तरीका है। सी ++ साल में ओओपी को कार्यान्वित करने के सबसे लोकप्रिय तरीकों में से एक है, सी ++ एक बहुत लोकप्रिय भाषा बन गई है और अधिक सी प्रोग्रामर सी ++ के लिए भविष्य में लोकप्रियता के पक्ष में एक अन्य कारक हैं जो कि सी के साथ लगभग पूरी तरह से निम्न संगत है (सी) जिसका अर्थ है कि सी प्रोग्राम, अधिकांश भाग के लिए, सी ++ प्रोग्राम के रूप में संकलित हो सकते हैं)। और अधिकांश कार्यान्वयन में सी + कोड के साथ सी + + कोड को जोड़ना संभव है। 12.16 चित्रा 10 संख्याओं की राशि की गणना और मुद्रित करने के लिए सी भाषा कार्यक्रम दिखाता है। कार्यक्रम की पहली कुछ पंक्तियां टिप्पणी बयान हैं। किसी भी टिप्पणी को प्रतीकों के भीतर रखा जा सकता है और फिर दो #include स्टेटमेंट प्रोग्राम को संकलित करने से पहले प्रोग्राम में मानक पुस्तकालय और मानक इनपुट आउटपुट हेडर फाइल को शामिल करने के लिए संकलक के निर्देश हैं।

 तब कार्यक्रम का मुख्य कार्य शुरू होता है। हर सी प्रोग्राम में एक मुख्य () फ़ंक्शन होना चाहिए, और सभी सी प्रोग्राम में केवल एक मुख्य () फ़ंक्शन हो सकती है। मुख्य समारोह के पहले रखा शब्द Vo इंगित करता है कि फ़ंक्शन एक मान वापस नहीं करता है। अगले दो बयान कार्यक्रम में प्रयुक्त चर के डेटा प्रकार की घोषणा करते हैं। योग और नर को फ्लोट घोषित किया गया ताकि वे आंशिक संख्या स्वीकार कर सकें, जबकि गणना को पूर्णांक घोषित किया गया है क्योंकि इसे केवल पूर्णांक मूल्यों को सौंपा जाना चाहिए। इन दो बयानों में, उनके मूल्यों को भी शून्य पर आरंभ किया जाता है। अगला बयान "के लिए" लूप शुरू होता है जो 10 नंबरों की राशि को स्वीकार करता है और गणना करता है। अंत में, प्रिंटफ़ स्टेटमेंट कंपेशन के परिणाम प्रिंट करता है। ई कार्यक्रम cou आईटीटी के लिए

Comments