Saturday, October 3, 2020

Basic information about C programming

 C Tokens

Just like any other programming C programming has 6 different tokens
  1. Keywords (there are 32 keywords in C89, lile int,flot)
  2. Identifiers (main)
  3. Constants
  4. Strings
  5. Special symbols
  6. Operators

Constant has further few more types.

1) Integer constants

Again there are three typeof integer constants. 
  • decimal
  • octal
  • hexa

int a = 5      / decimal
int a = 037  // octal 
int a = 0x3f  / hexa

2) Real contants

Like floating numbers having decimal notation and fractional part

C also understand mantissa e exponent

3.68E-7 is lile 3.68 x 10^-7

3) Single Char constant

'a' or '\0' null character

char constant has associated integer value known as ASCII values.

4) string constant

like 

char city = "Ahmedabad"

---

In C any varible/function name can not be long than 31 chares (in C89)
It should start with alphabet or _ 
(It can not start with Number)


No comments:

Post a Comment