Introduction to the C99 Programming Language : Part III

Kindly read Introduction to the C99 Programming Language (Part I) and Introduction to the C99 Programming Language (Part II) before reading this article.

  1. Addition of Library Functions: C99 provides some Additional Library functions listed below.
    Library Function Usage
    complex.h complex.h supports complex arithmetic
    fenv.h fenv.h gives access to floating point tags and floating point environments.
    inttypes.h inttypes.h gives support to handle long numbers (larger width numbers).
    It defines a standard, portable integer names
    iso646.h iso646.h defines macros corresponds to operators like && and ^
    stdbool.h stdbool.h supports boolean data types.
    It gives macros like bool, true and false.
    stdint.h stdint.h is included in inttypes.h header file.
    It gives standard, portable set of integer names.
    tgmath.h tgmath.h defines type-generic floating-point macors
    wchar.h wchar.h supports multibyte and wide character functions.
    wctype.h wctype.h supports multibyte and wide character classification functions.
  2. Addition of Format Specifiers: In C99 Standard, printf() and scanf() functions are modified in such a way that they have ability to handle modifiers long long and unsigned long long. The format specifier of long long int is ll and unsigned long long int is ul.

    The below sample program demonstrates the use of long long and unsigned long long values.

    filter_none

    edit
    close

    play_arrow

    link
    brightness_4
    code

    #include<stdio.h>
      
    int main()
    {
        long long int a=1121231456;
        unsigned long long int b=1124154632;
        printf("Long Number: %lld and"
    " Unsigned long: %llu",
     a, b);
    }

    chevron_right

    
    

  3. __func__ Identifier:
    C99 adds __func__ identifier which returns the name of the function invoked as string. In simple, if __func__ is called in function fun1() then it returns the string fun1.

  4. Implicit int Declarations:
    In C89 standard, we don’t need an explicit declaration of integer return type in functions i.e If we declare function_name(parameters), the compiler will assume the integer as default return type. In C99, All implicit function declarations are no longer supported. Some compiler will raise errors while some shows the same error as warning. GCC compiler shows that as a warning.

  5. Void Return Types:
    In C89 Standard, we can omit return values for functions. If we write int fun1() and execute it without specifying return value, the compiler will execute automatically by taking default return value. This value can either be 0 or garbage value. But in C99, If we write int fun1() without return statement in it then the compiler treats that as an error.

  6. Extended Integer Types: C99 standard gave several extensions to integer types.
    Extended Type Meaning
    int16_t Integer has exactly 16 bits
    int_least16_t Integer has at least 16 bits.
    int_fast32_t Fastest Integer types that has at least 32 bits.
    intmax_t Holds the Largest Integer Type
    uintmax_t Holds the Largest unsigned Integer Type

    These are generally used rarely.

These are some of the major changes that include addition, change and deletion of features in C89 to get C99 Standard.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up

**Passionate about things** **A Quick Learner** **Always strive for Perfection** **Campus Mantri and Technical Content Writer**

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.