Prog Is Not A Four Letter Word Rar

  пятница 07 февраля
      32

C variable naming rules

This page lists all the 4 letter words that end with 'rar' Word Game Helper. Letter Words Ending With rarThere are no 4-letter words ending with 'rar ' Other Info & Useful Resources for the Word ' rar'Info Details; Number of Letters in: rar3: More info About: rarrar: List of Words Starting with: rar.

Pritesh

Rules For Constructing Variable Name

  1. Characters Allowed :
    • Underscore(_)
    • Capital Letters ( A – Z )
    • Small Letters ( a – z )
    • Digits ( 0 – 9 )
  1. Blanks & Commas are not allowed
  2. No Special Symbols other than underscore(_) are allowed
  3. First Character should be alphabet or Underscore
  4. Variable name Should not be Reserved Word

Explanation with Example

Tip 1 : Use allowed Characters

Valid Names

Tip 2 : blanks are not allowed

Mala jau dya na ghari song translation. Invalid Names

Tip 3 : No special symbols other that underscore

Valid Identifier

Tip 4 : First Character must be underscore or Alphabet

Valid Identifier

Invalid Identifier

Tip 5 : Reserve words are not allowed

  • C is case sensitive.
  • Variable name should not be Reserve word.
  • However if we capitalize any Letter from Reserve word then it will become legal variable name.

Valid Identifier

Invalid Identifier

Tip 6 : Name of Identifier cannot be global identifier

Basic Note :

  • Global predefined macro starts with underscore. (_) .
  • We cannot use Global predefined macro as our function name.

Example : Some of the predefined macros in C

  • __TIME__
  • __DATE__
  • __FILE__
  • __LINE__

Valid Identifier

Invalid Identifier

Tip 7 : Name of identifier cannot be register Pseudo variables

Invalid Example :

Tip 8 : Name of identifier cannot be exactly same as of name of another identifier within the scope of the function

Valid Example :

Invalid Example : We cannot declare same variable twice within same scope

Tip 9 : Constants

  1. We know that M_PI constant is declared inside math.h header file.
  2. Suppose in our program we have declared variable M_PI and we have not included math.h header file then it is legal variable.

Legal Example :

Output :

Illegal Example :

Output :

Remember following Tricks

  1. Do not Create unnecessarily long variable name
  2. Do not use underscore as first character to avoid confusion between System Variable & user defined variables because many system variables starts with undescore
  3. Variable names are case-Sensitive . i.e sum,Sum,SUM these all three are different variable names.
  4. Reserve words with one/more Capital letters allowed eg. Int,Float,chAr are allowed but try to skip them.