Read in Hindi
Read in English

Going forward with this C/C++ programming language tutorial today we will continue to learn about Memory. Last time we have seen that computer reads 1 byte(8 bits) from memory in one access. since 1 bit can store either of 0 or 1 hence 1 byte can store any number from 00000000 to 11111111(8 digit binary number). It is not convenient to read or write numbers in binary format hence we write it is decimal form.
00000000 = 0 (in decimal)
11111111 = 28 -1 = 255 (in decimal)
Hence in 8 bit or 1 byte numbers from 0 to 255 can be stored.
Similarly if we want to store number greater than 255, we have to take 2 bytes together. In 2 byte number from 00000000 00000000 to 11111111 11111111(0 to 65535) can be stored. Now we will see how different kind of datatype variables are stored.
char: See ASCII table. In the table each character have corresponding Decimal number. When we store any letter char variable, computer stores corresponding number in memory. If we store 'a', number corresponding to that is 97(01100001) which will be stored. According to the table we do not need to store number greater than 255 to store character hence 1 byte memory is needed to store char variable.
short int: short int variable is stored in 2 byte(16 bits). In 2 bytes any number from 0 to 65535(216-1) can be stored. Since short int can take negative value too hence it can take values from-32768(-215) to 32767(215-1).
unsigned short int: This also takes 2 bytes but does not take negative values hence any number from 0 to 65535 can be stored
int: It takes 4 bytes and can take negative value hence any number from -231 to 231-1 can be stored in this variable.
unsigned int: This also takes 4 byte but only positive values hence any number from 0 to 232-1 can be stored.
float: format to store this type of number is complex because it can take fraction values too. I takes 4 byte.
double: It takes 8 byte and can take fraction values.
There are some other datatypes also which are not needed at this point of time.

Last time we have seen that computer reads memory as byte by byte. Each byte have an address, as 1st byte have address 0, 2nd byte have address 1... When computre writes a value to variable, it also remembers address of memory where value is written. If variable takes more than 1 byte then all bytes are stored continuously and address of 1st byte is remembered. For example if int(4 bytes) is stored in memory from 101st byte to 104th byte then its address will be 101.
Now you are ready to know about pointer. In next topic we will learn about pointer.
आज Hindi के इस C/C++ programming language tutorial को आगे बढ़ाते हुए हम Memory के बारे में थोडा और जानेंगे. पिछली बार हमने यह जाना कि computer एक बार में 1 byte(8 bits) read करता है. चूंकि हर 1 bit में 0 या 1 में से कुछ store हो सकता है इसलिए 1 byte में 00000000 से लेकर 11111111 तक की कोई भी संख्या (8 अंको की binary संख्या) store हो सकती है. लिखने और पढ़ने में 00000000 और 11111111 आसान नहीं है इसलिए हम इसे decimal में convert करके पढते हैं.
00000000 = 0 (in decimal)
11111111 = 28 -1 = 255 (in decimal)
इसलिए इस 8 bit या 1 byte में 0 से 255 तक की कोई भी संख्या store हो सकती है.
इसी तरह अगर हमें और ज्यादा बड़ी संख्या store करना हो तो हम 2 byte को एक साथ लेकर उसमे store करेंगे. 2 byte में 00000000 00000000 से 11111111 11111111 यानी 0 से 65535 तक कि संख्या store हो सकती है. अब हम देखते हैं कि विभिन्न datatype किस तरह से store किये जाते हैं.
char: ASCII table को देखिये इसमें हर एक अक्षर(character) के सामने एक Decimal संख्या लिखी हैं. जब हम char variable में कोई अक्षर store करते हैं तो computer उस अक्षर के सामने वाली संख्या को store कर देता है. जैसे कि अगर हम 'a' store करते हैं तो उसके सामने लिखी संख्या 97(01100001) store हो जायेगी. उस table के अनुसार किसी भी अक्षर को store करने के लिए 255 से बड़ी संख्या की जरूरत नहीं है इसलिए char को store करने के लिए 1 byte memory कि जरूरत होती है.
short int: short int variable 2 byte(16 bits) में store होता है. 2 byte में 0 से 65535(216-1) तक कि संख्या store कर सकते हैं. चूंकि short int negative value भी ले सकता है इसलिए यह -32768(-215) से 32767(215-1) तक के मान ले सकता है.
unsigned short int: यह भी 2 byte कि जगह लेता है परन्तु negative value नहीं ले सकता इसलिए 0 से 65535 तक के मान ले सकता है.
int: यह 4 byte लेता है और negative value भी ले सकता है इसलिए -231 से 231-1 तक की value ले सकता है.
unsigned int: यह भी 4 byte लेता है परन्तु केवल positive value इसलिए 0 से 232-1 तक की value ले सकता है.
float: इसके store करने का format complex है क्योंकि यह दशमलव value भी ले सकता है. यह 4 byte लेता है.
double: यह 8 byte लेता है और दशमलव value भी ले सकता है.
इसी  तरह कुछ और भी datatype होते हैं जिनके बारे में जानना अभी आवश्यक नहीं है.

पिछली बार हमने देखा था कि computer, memory को एक एक byte read कर सकता है. हर byte का एक address होता है जैसे पहली byte का address 0, दूसरी byte का address 1... इस तरह से. जब computer किसी variable की value memory में कहीं किसी byte पर लिखता है तो उस byte का address भी याद रखता है. अगर कोई variable(जैसे int) एक से ज्यादा byte लेता है तो continuous store करते हुए पहली byte का address याद रखा जाता है. जैसे कि अगर int(4 bytes) 101st byte से 104th byte तक store हुआ है तो इस int का address 101 हुआ.
अब आप pointer के बारे में जानने के लिए ready है. अगली बार हम pointer के बारे में पढेंगे.