Variable and It’s Types

Variable and It's Types

Variable

हम Variable को Value, Store करने के लिए Memory के Parts के रूप में define कर सकते हैं।
Example:-

       a = 5;
       b = 2;
      a = a + 1;
Result = a – b;

प्रत्येक variable को एक name की आवश्यकता होती है जो इसे identify करता है और इसे दूसरों से अलग करता है। उदाहरण के लिए, पिछले code में Variable name a, b और Result थे, लेकिन हम variable को किसी भी name से Call कर सकते थे, जब तक कि वे Valid C++ identifies करते थे।

Identifiers:

एक Valid Identifiers एक या अधिक Letters, Digits या Underscores words (_) का Sequence होता है। रिक्त स्थान(Spaces), (punctuation marks) विराम चिह्न और Symbols identifiers का Part नहीं हो सकते। इसके अलावा,Identifiers हमेशा एक Letters से शुरू होंगे।

वे एक Underline character (_) के साथ भी शुरू हो सकते हैं, लेकिन ऐसे Identifiers ज्यादातर मामलों में होते हैं- Compiler keywords बाहरी Identifiers के लिए Reserved माने जाते हैं, साथ ही Identifiers में कहीं भी दो लगातार underscore character होते हैं। किसी भी स्थिति में वे एक Digit से शुरू नहीं हो सकते।

C++ Operations और data description की identification करने के लिए कई keywords का उपयोग करता है; इसलिए, programmers द्वारा बनाए गए Identifiers इन keywords से match नहीं खा सकते हैं। programmers द्वारा बनाए गए Identifiers के लिए उपयोग नहीं किए जा सकने वाले Standard reserved keywords हैं:

alignas, alignof, and, and_eq, asm, auto, bitand, bitor, bool, break, case, catch, char, char16_t, char32_t, class, compl, const, constexpr, const_cast, continue, decltype, default, delete, do, double, dynamic_cast, else, enum, explicit, export, extern, false, float, for, friend, goto, if, inline, int, long, mutable, namespace, new, noexcept, not, not_eq, nullptr, operator, or, or_eq, private, protected, public, register, reinterpret_cast, return, short, signed, sizeof, static, static_assert, static_cast, struct, switch, template, this, thread_local, throw, true, try, typedef, typeid, typename, union, unsigned, using, virtual, void, volatile, wchar_t, while, xor, xor_eq

Very Important :

C++ Language एक “Case sensitive” LANGUAGE है। इसका मतलब यह है कि Capital Letter में लिखा गया एक Identifier उसी नाम के दूसरे Identifier के बराबर नहीं है जो small letter में लिखा गया है। इस प्रकार, Example के लिए, RESULT variable, Result variable या result variable के समान नहीं है। ये तीन अलग-अलग identifiers हैं जो तीन अलग-अलग variable की identification करते हैं।

Fundamental Data Types :

Variable के value को Computer memory में Zero और one के form में एक Unspecified place पर कहीं Store होते हैं। हमारे Program को उस exact location को जानने की आवश्यकता नहीं है जहां एक variable, store किया जाता है;

यह बस इसे इसके name से refer कर सकता है। Program को जिस चीज के बारे में पता होना चाहिए वह Variable में Storage data types है। यह एक साधारण Integer को Store करने के लिए समान नहीं है क्योंकि यह एक letter या large floating Point number को store करने के लिए है; भले ही वे सभी Zero और ones का उपयोग करके दर्शाए जाते हैं, उन्हें उसी तरह से explained नहीं किया जाता है, और कई cases में, वे Memory की Same amount, occupy नहीं करते हैं।

Fundamental data types, language द्वारा सीधे लागू किए गए basic types हैं जो अधिकांश प्रणालियों द्वारा मूल रूप से समर्थित basic storage units का support करते हैं। उन्हें basic types से classified किया जा सकता है:

character type: वे एक letter का प्रतिनिधित्व कर सकते हैं, जैसे ‘a’ या ‘$’। सबसे basic type char है, जो one-byte character है। wider characters के लिए अन्य प्रकार भी प्रदान किए जाते हैं।

Numerical integer types:  वे एक integer number value store कर सकते हैं, जैसे कि 7 या 1024। वे विभिन्न आकारों में मौजूद हैं, और या तो signed या unsigned हो सकते हैं, यह इस बात पर depend करता है कि वे negative value का समर्थन करते हैं या नहीं।

Floating point types:  वे Real Values का प्रतिनिधित्व कर सकते हैं, जैसे कि 3.14 या 0.01, सटीकता(precision) के विभिन्न स्तरों के साथ, तीन floating-point प्रकारों में से किस पर निर्भर करता है।
Boolean types: boolean type , जिसे C ++ में bool के रूप में जाना जाता है, केवल दो states में से एक का प्रतिनिधित्व कर सकता है, true या false।

Previous articleMemory Management Function- Logical and Physical address Space
Next articleControl Statement in C

LEAVE A REPLY

Please enter your comment!
Please enter your name here