Token In C Programming In HINDI

हेलो दोस्तों , आज हम जानने की कोशिश करेंगे कि Character set , Tokens , Keywords , variables , Operators , Identifier , Constant e.t.c यह सब क्या है और इसका इस्तेमाल C Programming में क्यों किया जाता है तो चलिए शुरू करते है।


Character set 

एक Character set alphabets , letters और कुछ special character का एक समूह है जो C language मे valid है।

Alphabets :

Uppercase :- A B C D..................
Lowercase :- a b c d...................

Note:- C language , lowercase और uppercase alphabets दोनों को variables और functions के रूप में accept करता है।

Digits :

0 1 2 3 4 5 6 7 8 9

Whitespace characters : 

Spacecharacter , horizontal tab , vertical tab , newline character and form feed.

Other characters :

Alert , null character , backspace and carriage return.

Token क्या है ?

  • किसी भी program में use होने वाले individual units को Token कहते हैं।
  • यह compiler के लिए meaningful है।
  • C programming में Token को मूल building block कहा जाता है ?

Type of Tokens

1.keywords
2.Identifiers
3.operators
4.constant
5.variable

Keywords क्या है ?

  • Keywords एक predefined , reserved words है जो program में specific कार्य करने के लिए use किया जाता है।
  • इसको user द्वारा change नहीं किया जा सकता है
  • Keyboards syntax का part है और इसका use identifier के रूप में नहीं किया जा सकता है।
  • सभी keywords को lower case में लिखना अनिवार्य है।
Example:-  int  money ;

यहां, int एक keywords है जो money को एक variable (type of int) के तरह indicate कर रहा है।

जैसा कि हम सब जानते हैं C एक case sensitive language है , सभी keywords को lowercase में लिखा जाना चाहिए

यहां ANSI C में allowed सभी keywords की एक सूची दी गई है आइए देखते हैं।

Tocken in C in HINDI


Identifiers क्या है ?

  • Identifier, user defined words है और इसका उपयोग variables , arrays , functions , structures आदि जैसी entities को नाम देने के लिए किया जाता है
                       
Example :- int money ;
                  double accountBalance ;
यहां पर money और accountBalance , identifier है।

Rules for naming identifiers are-

(1)Name में केवल uppercase और lowercase letters, digits और underscore sign(_) शामिल होना चाहिए।
(2) first character एक alphabets या underscore होना चाहिए।
(3) नाम एक keywords नहीं होना चाहिए।
(4) चूंकि C , case sensitive है इसलिए uppercase और lowercase अलग माने जाते हैं।
Example:-money , Money , MONEY etc
(5) एक identifier का नाम arbitrarily(मनमाने ढंग से) long हो सकता है।

आइए अब हम लोग कुछ valid identifier का example देखते हैं।
zara , abc , _data , a_123 , _temp , a23b9 , retVal ete.

आइए अब हम लोग कुछ invalid identifier का example देखते हैं।
int :-  (because it is a keywords)
9bc :-(first character एक alphabets या underscore होना चाहिए।)
Roll  no :-(blank space की अनुमति नहीं है)
name# :-(because # एक special operator है)
Sumno :-(because there is no space between sum and no)

Note:- All the words that we will use in our C programs will either keyboard or identifiers.

Conclusion:-

यदि आप ऊपर दिए गए Rule को follow करते हैं तो आप identifiers के रूप में किसी भी नाम का चयन कर सकते हैं। हालाकी identify करने वाले identifiers को सार्थक नाम देना चाहिए।