THE C ELEMENTS

C ELEMENTS

3. TRIGRAPH CHARACTERS :

There are chances or possibilities when the keyboard doesn’t print some characters probably due to any reason. C supports the facility of “TRIGRAPH SEQUENCE” to print these characters.

The Trigraph sequences have three characters. The first two are 2 consecutive question marks i.e. “??“. The third character can be any character from C character set.

Trigraph sequences in C elements
http://www.tweakstudy.com

These are some of the Trigraph sequences in C elements.

4. DELIMITERS :

Delimiters are one of the most important C elements. They are used in almost every C program for providing the program a Syntactic meaning.

Basically, a Delimiter is an order of a number of characters which defines the beginning or ending of a particular statement.

Delimiters in C - C ELEMENTS
http://www.codecognitive.com

Above given are the Delimiters which we use in a C Program.

5. KEYWORDS :

Keywords are those specific words that the compiler reserves or retains in the library for doing some certain tasks. These are unique words, they have Standard and have a predefine meaning in C.

Keywords are always written in lowercase because C Language is a case sensitive Language.

In C Language, there are only 32 keywords available which are given below –

Keywords in C Language - C ELEMENTS
http://onlinedigitaltechnology.com

6. IDENTIFIERS :

All the words that we all will use in C programs will be either KEYWORDS and IDENTIFIERS. Keywords are the predefined words and can’t be changed by the user. In contrast, Identifiers are user defined words which we use to give names to entities such as

  • VARIABLES
  • ARRAYS
  • FUNCTIONS
  • STRUCTURES,etc.

There are certain rules which the user should follow while naming identifiers. The rules for naming identifiers are Given below –

  1. The name should consist of only alphabets that maybe in both uppercase or lowercase, digits and underscore sign(_).
  2. The first character of the identifier should be an alphabet or an underscore.
  3. The name of the identifier should not be a keyword.
  4. Because C is a case sensitive language, the uppercase and lowercase letters are consider differently​. For example, add, Add and ADD are three different identifiers.
  5. An identifier name maybe whimsically long. Some implementations of C language recognise only the first eight characters, and most implementations recognise 31 characters.

Generally, identifiers are given meaningful names by the users. Some examples​ of valid identifier names are –

  • Value
  • c
  • add_fun
  • net1
  • _value
  • Marks

Some examples of invalid identifier names are –

  • 3add – the first character should be an alphabet on an underscore.
  • Char – char is a keyword
  • VAlue# – # is a special character
  • Avg no – blank space should not be there in between..

7. DATA TYPES :

C Language sustains various types of data. Data type is simply defined as the type and size of the data linked with variables and functions. The Storage representation of these data types varies in C memory.

ANSI C supports four classes of data types that are

  1. FUNDAMENTAL DATA TYPES
  2. USER-DEFINED DATA TYPES
  3. DERIVED DATA TYPES
  4. EMPTY DATA SET

There are four fundamental data types in C which every compiler supports. They are int, char, float and double.

USES OF FOUR FUNDAMENTAL DATA TYPES :

  • char” data type for storing any single character.
  • int” data type for storing integer value.
  • float” data type for storing single precision floating point number or decimal values.
  • double” data type for storing double Precision floating point number.

To get some more types, we can also use Type qualifiers with these basic data types. There are two types of type qualifiers which are –

  1. SIZE QUALIFIERS – short, long
  2. SIGN QUALIFIERS – signed, unsigned

By using the qualifier Unsigned, the number is therefore always positive. The number maybe positive or negative by using Signed qualifier. If the sign qualifier is not mentioned by the user, then by default signed qualifier is presumed by the compiler.

The size and range of different data types on a 16-bit machine is given in the following table. [ The size and range may vary on machines with different word sizes ]

Size and Range of different data types - C ELEMENTS
http://www.allaboutcomputing.net

Leave a comment

Your email address will not be published. Required fields are marked *

11 thoughts on “THE C ELEMENTS”