Tokens in C Programming

C Tokens are the individual words and punctuation, which is the smallest element of a program, understandable by the compiler. In easier language, C tokens are individual units in a program. In this lesson, we will learn about Tokens in C Programming.

Identifiers

Identifiers in C language are used for naming variables, functions, and arrays. Do not use keywords as identifiers.

You cannot use keywords as identifiers; they are reserved for special use.

Here are some examples of valid identifiers,

To name C Identifiers, follow these rules:

  • The identifier must begin with a letter or underscore (_).
  • C identifiers must consist of only letters, digits, or underscore.
  • Do not add any special characters to the identifiers.
  • Should not be a keyword.
  • It should not contain any white space.

Keywords

Keywords are reserved words used in programming languages. The compiler already knows these names, so you cannot use them as variable names,

Total of 32 keywords are part of C language, which are known to the C compiler.

Here is a list,

Tokens in C Programming

Whitespace

White space in C language includes vertical tab, horizontal tab, blank, comments, form feed, end-of-line, etc. A line with whitespace isn’t considered by the compiler. You can add a comment there itself as shown below,

Use whitespace to separate parts of statements, for example,

If you liked the tutorial, spread the word and share the link and our website Studyopedia with others:


For Videos, Join Our YouTube Channel: Join Now


Read More:

How to install CodeBlocks IDE and run first C program
Variables in C Programming
Studyopedia Editorial Staff
Studyopedia Editorial Staff
[email protected]

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue Reading