Ticker

6/recent/ticker-posts

C Introduction, Keywords and Identifiers

C Introduction




C is a general-purpose programming language that may be used for a wide range of applications. It can be used to develop operating systems, databases, and compilers, among other things. C programming is an excellent language to learn for beginners.

Our C tutorials will walk you through the process of learning C programming step by step.

Keywords and Identifiers in C

In C programming, keywords are reserved terms that are part of the syntax, and you'll learn about them in this tutorial. You'll also learn how to name identifiers and what they are.

C Keywords

auto        double        int        struct

break        else        long        switch

case        enum        register        typedef

char        extern        return        union

continue        for        signed        void

do        if        static        while

default        goto        sizeof        volatile

const        float        short        unsigned


C Identifiers


In C, identifiers A name assigned to an item such as a variable, function, or structure is called an identifier.

It is necessary to use unique identifiers. They're designed to give an entity a distinct name so that it can be identified during the execution of the program. Consider the case below:

int money

double annualSalary ;

In this situation, money and annualSalary are identifiers.

Keep in mind that identifier names and keyword names must be separate. You can't use int as an identifier because it's a keyword.


Naming conventions for identifiers


1. In a valid identifier, letters (including capital and lowercase letters), digits, and underscores can all be used.

2. The first letter of an identifier should be either a letter or an underscore.

3. Integers, whiles, and other keywords cannot be used as identifiers.

4. The length of an identifier is unrestricted. However, if the identity is longer than 31           characters, some compilers may encounter problems.

You can use any name as an identifier if you fulfil the preceding conditions; nevertheless, give meaningful names to identifiers that make sense.

Post a Comment

0 Comments