Keywords and Identifiers in C Programming in Hindi

इस Tutorial में C Keywords और C Identifiers के बारे में पढ़ेंगे. Keywords और Identifiers दोनों ही C programs के syntax का important parts होते है.  

Keywords in C in Hindi – C Keywords क्या है?

जैसे हमारी भाषा हिंदी में “हंसना, रोना, दौड़ना” शब्दों का पहले से ही एक मतलब है और इसलिए हम इन शब्दों को किसी और काम के लिए use नहीं करते हैं ठीक ऐसे ही programming में होते हैं keywords.

Keywords ऐसे reserved words है जिनका C programming में पहले से ही specific meaning है या मैं कहूं की C programming keywords सिर्फ predefined function (काम) के लिए ही use किये जा सकते हैं.

अब जैसा की आप समझ ही गए की C keywords का meaning और use पहले से ही fixed है इसलिए आप keywords को किसी और काम के लिए use नहीं कर सकते हैं.

C programming language में 32 keywords हैं और C keywords हमेशा lowercase में लिखे जाते हैं. नीचे सभी 32 keywords की list दी गयी है.

C Keywords
auto break case continue
do default const double
else enum extern for
if goto float int
long register char signed
static sizeof short struct
switch typedef union void
while volatile return unsigned

Identifiers in C in Hindi – C Identifiers क्या है?

हमारे आसपास हर चीज का नाम होता है चाहे वो कोई व्यक्ति हो या कोई सामान. अगर किसी व्यक्ति या चीज का नाम ना हो तो उसे call (identify) करना मुश्किल हो जायेगा इसलिए नाम होना जरूरी है.

ऐसे ही एक C program में बहुत से elements होते हैं जैसे की variables, constants, functions, array etc. और इन सभी का भी नाम होता है और इनके name को ही हम Identifiers कहते हैं.

आसान शब्दों में समझे तो C language में variables, constants, functions और user-define data types को जो names दिये जाते हैं उसे ही हम Identifiers कहते हैं और इन्ही Identifiers (names) की help से programmer और compiler इन elements को identify (call) करता है.

Programming में ये identifiers (names) कुछ set of rules के साथ defined किये जाते हैं. अगर आप C identifiers rules follow नहीं करेंगे तो हो सकता आपके program में errors show हो.

Rules for an Identifiers in Hindi

जैसे एक ही family में दो बच्चों का same name नहीं होता ठीक ऐसे ही एक C program में 2 elements जैसे की 2 variables का same identifier (name) नहीं हो सकता यानी identifiers unique ही होने चाइये.

C Identifiers में सिर्फ alphanumeric characters ( a-z , A-Z , 0-9 ) और underscore ( _ ) का use कर सकते हैं. आप special characters ( !, @, #, etc.) का use C identifier में नहीं कर सकते. 

C Identifiers की शुरुआत यानी first character सिर्फ alphabet( a-z , A-Z ) or underscore ( _ ) से ही हो सकती है यानी आप number ( 0-9) से C identifier की शुरुआत नहीं कर सकते. इसके अलावा ये rule भी ध्यान रखिएगा की C identifiers में space allowed नहीं होता है.

C programming case sensitive language है और इसलिए num, Num और NUM को तीन अलग-अलग identifiers माना जाएगा. इसके अलावा इस बात का विशेष ध्यान रखियेगा की आप C identifier में आप keywords का use नहीं कर सकते.

Invalid Identifiers के examples:

  • int – ये एक keyword इसलिए आप इसे identifier के तौर पर use नहीं कर सकते.
  • 2num – Identifier की शुरुआत alphabet या undersore symbol से ही होनी चाइये.
  • f@num – Identifier में special symbol allowed नहीं है.
  • first num – Identifier में space allowed नहीं है.

C Identifiers के लिए मेरा Personal Suggestion

कहते है की “नाम बड़ी चीज है” इसलिए हम हर चीज का नाम बहुत सोच समझ कर रखते है लेकिन ये बात कुछ programmer C program elements (variable, function, array etc.) का नाम रखते वक्त भूल जाते हैं.

मेरे कहने का ये मतलब है की जब भी आप किसी variable, function, array etc. को identifier assign करें तो उसके use का ध्यान रखें यानी वो elements आपके program में किस काम के लिए use हो रहा है.

जैसे की अगर आप किसी variable में value के तौर पर किसी की age hold करना चाहते हो तो उस variable का नाम आप age ही रखेंगे तो ये एक good programming practice मानी जाएगी.

C program में variable, function, array, structure etc. को meaningful identifier देने का आपको ये भी फायदा होता है की आपका code किसी अन्य programmer को भी आसानी से समझ आ जाता है.

अगर आप भी अपने code में बहुत समय बाद changes करेंगे तो आपको भी अपने code को समझने में आसानी होगी.

C Keywords and Identifiers में क्या अंतर है?

C Keywords C Identifiers
Keywords C language में predefined reserved words होते हैं. Identifiers C language में variable, function etc. के user defined names होते हैं.
Keywords सिर्फ lowercase में होते हैं. Identifiers में lowercase, uppercase या दोनों हो सकते हैं.
Keywords में सिर्फ alphabetical characters होते हैं. Identifiers में alphanumeric characters और underscores होते हैं.
C Keywords Examples: for, struct, int C Identifiers Examples: num, ch, height

What’s Next: इस tutorial में हमने C programs में keywords और identifiers का मतलब समझा. Next tutorial में हम समझेंगे की C programming में Data Types क्या होते हैं?