Notes in Hindi

What are C Language Standards (ANSI, ISO) in Hindi

/ BCA / Programming with C and CPP

C Language Standards and Their Importance in Hindi

What are C Language Standards (ANSI, ISO) in Hindi

जब C Language बनाई गई थी, तब इसकी कोई तय "standard" भाषा नहीं थी। इसका मतलब यह है कि हर programmer या company अपनी जरूरत के अनुसार C को अलग-अलग तरह से इस्तेमाल कर रही थी। इससे एक बहुत बड़ी समस्या सामने आई — एक जगह लिखा गया code, दूसरी जगह काम नहीं करता था। इस समस्या को दूर करने के लिए C Language के लिए एक common और universal मानक यानी "standard" तय करने की ज़रूरत महसूस हुई। यही मानक "C Language Standards" कहलाते हैं।

C Standards का उद्देश्य है कि C Language का structure, syntax, और behavior हर platform पर एक जैसा रहे। इससे portability और compatibility में आसानी होती है।

C के दो मुख्य standards हैं:

  • ANSI C: इसे American National Standards Institute द्वारा 1989 में standard किया गया। इसे C89 या C90 भी कहा जाता है।
  • ISO C: इसे International Organization for Standardization द्वारा 1990 में स्वीकार किया गया। ISO ने ANSI C को ही adopt किया, लेकिन इसके बाद इस पर और सुधार भी किए गए।

इन standards के versions इस प्रकार हैं:

Version Year Description
ANSI C / C89 1989 American standard version
ISO C / C90 1990 International standard version (same as ANSI C)
C99 1999 New features like inline functions, long long int, _Bool, variable length arrays
C11 2011 Multithreading support, improved Unicode handling
C17 2017 Minor bug fixes and standard maintenance

Key features of ANSI C standard in Hindi

ANSI C, जिसे formal रूप से C89 कहा जाता है, ने C language को एक मजबूत और universal base दिया। इसके कुछ प्रमुख features नीचे दिए गए हैं:

  • Function Prototypes: ANSI C में functions को declare करते समय उनके arguments और return type को clearly define करना जरूरी होता है।
  • Standard Header Files: ANSI C ने कई standard header files को define किया जैसे stdio.h, stdlib.h, string.h आदि।
  • Structured Code Format: Proper indentation और block structure को promote किया गया ताकि code पढ़ने और समझने में आसान हो।
  • Predefined Constants: जैसे NULL, EOF को introduce किया गया।
  • Function return types: अब हर function को return type के साथ define करना आवश्यक हो गया। जैसे कि int main()
  • Standard I/O Library: ANSI C ने एक strong I/O system provide किया जिसमें printf(), scanf(), getchar(), putchar() शामिल हैं।
  • Portable Code: अब code को किसी भी machine पर चलाना आसान हुआ क्योंकि syntax और behavior एक जैसा हो गया।

Differences between K&R C and ANSI C in Hindi

K&R C, यानी Kernighan और Ritchie द्वारा बनाई गई original C language थी जो 1978 में सामने आई। इसे ही सबसे पहले UNIX operating system बनाने में use किया गया था। इसके बाद ANSI C आया जो इसको और ज्यादा standard और universal बनाने के लिए बनाया गया।

Feature K&R C ANSI C
Function Declaration No prototype; arguments define body में होते थे Prototype जरूरी होता है; arguments को पहले declare किया जाता है
Header Files Limited और inconsistent Proper और well-defined standard headers
Data Type Support Basic data types ही होते थे New types जैसे void, enum, const, volatile जोड़े गए
Standard Library Defined नहीं था Standard library functions define की गई
Error Handling कमज़ोर Strong error checking
Portability Limited High portability

Importance of C Language Standards in Hindi

C Language Standards का होना बहुत आवश्यक है क्योंकि ये language को सभी platforms पर एक जैसा बनाते हैं। बिना standards के code अलग-अलग compilers या machines पर अलग तरह से behave कर सकता है, जिससे बहुत सारी समस्याएं होती हैं। नीचे कुछ महत्वपूर्ण कारण दिए गए हैं जो बताते हैं कि C Standards क्यों ज़रूरी हैं:

  • Portability: एक ही code को बिना change किए अलग-अलग platforms पर चलाया जा सकता है।
  • Compatibility: किसी भी standard compiler पर code compile और run हो सकता है।
  • Maintainability: Standard code को पढ़ना, समझना और maintain करना आसान होता है।
  • Reusability: Standard functions और modules को दोबारा उपयोग करना आसान होता है।
  • Better Documentation: जब कोई language standard होती है तो उसके साथ complete documentation और guidelines मिलती हैं।
  • Tool Support: IDEs और debugging tools बेहतर support प्रदान करते हैं standard C के लिए।
  • Long-term Stability: एक बार standard बन जाने के बाद language में बदलाव धीरे-धीरे और सोची-समझी strategy से होते हैं, जिससे backward compatibility बनी रहती है।

इसलिए जब भी हम C language सीखते हैं या किसी project में C का use करते हैं, तो हमें हमेशा ANSI/ISO standards के अनुसार code लिखना चाहिए। इससे हमारा code universal, maintainable और future-ready बनता है।

FAQs

ANSI C, C language का वह version है जिसे American National Standards Institute ने standard किया था। इसे C89 या C90 भी कहा जाता है। यह version function prototype, standard headers और portable code के लिए जाना जाता है।
C Language Standards बहुत जरूरी हैं क्योंकि यह language को universal और portable बनाते हैं। इनके कारण code को किसी भी compiler या operating system पर आसानी से चलाया जा सकता है।
K&R C पुराना version है जिसमें function declaration में prototype नहीं होता था, जबकि ANSI C में prototype अनिवार्य है। ANSI C में standard headers, नए data types और better portability शामिल हैं।
ANSI C की मुख्य विशेषताएं हैं function prototypes, standard library headers, proper error handling, portable code structure, और improved syntax जिससे code maintain और reuse करना आसान होता है।
ISO C वह standard version है जिसे International Organization for Standardization द्वारा 1990 में स्वीकार किया गया। यह ANSI C पर आधारित है लेकिन समय के साथ इसमें और updates जोड़े गए जैसे C99, C11, C17।
ANSI C standard में code लिखना इसलिए जरूरी है क्योंकि यह portability, compatibility और maintainability को बेहतर बनाता है। इसके अलावा सभी modern compilers ANSI C को support करते हैं जिससे error की संभावना कम हो जाती है।

Please Give Us Feedback