C Variables and its properties

Last Updated :

Prerequisite – Introduction to C programming language, Variables in C
Variable is named location of data. In other words, variable is container of data. In real world we have used various type containers for specific purpose. For example, we have used suitcase to store clothes, match box to store match sticks etc. In the same way, variable of different data type is used to store different types of data. For example, integer variables are used to store integers, char variables are used to store characters etc.

On the basis of how many data a variable will store, we can categorize all C variable in three groups:

  1. Those variable, which can store only one data at a time.
    Example: Integer variable, Char variable, Pointer variable etc.
  2. Those variable, which can store more than one data of similar type at a time.
    Example: Array variables
  3. Those variable, which can store more than one value of dissimilar (or different) types at a time.
    Example: Structure of Union variables

Properties of C Variables :
Every variable in C have 3 most fundamental attributes. These are :

  1. Name
  2. Value
  3. Address

Every variable in C has its own name. A variable without any name is not possible in C. Most important properties of variables name are its unique names.

Also, no two variables in C can have same name with same visibility.

It is possible that two variable with same name but different visibility. In this case, variable name can access only that variable which is more local. In C, there is no way to access global variable is any local variable is present of same name.

You can watch this good video about this topic:

If you would like to contribute, you can also mail your article to raju.cplusplus@gmail.com. Please suggest your improvement for this article if you find anything incorrect.

Comment
Next Article
Mithlesh Upadhyay Published 04 May, 2020 · 2 min read

Mithlesh Upadhyay is a Computer Science and AI expert from Madhya Pradesh with strong academic background (BE in CSE and M.Tech in AI) and over six years of experience in technical content development. He has contributed tech articles, led teams, and worked in Full Stack Development and Data Science. He founded the w3colleges.org portal for learning resources.

Article Tags :

Similar Reads

  • What should we use void main() or int main() ?

    There is question that what should we use void main() or int main() ? void main() { /* ... */ } Or, int main() { /* ... */…

    2 min read
  • C Comments

    Prerequisite – C Language Introduction C comments explain code and improve readability. These do not affect program execution. You can use comments in C to clarify code and describe…

    1 min read
  • C Programming Language Standard

    Prerequisite – C Language Introduction The C programming language has various versions: C89/C90, C99, C11, and C18. C89/C90: Released in 1989/1990. It introduced key language features. C99: This…

    2 min read
  • Features of C Programming Language

    Prerequisite – C Language Introduction C is a simple language made in 1972 by Dennis Ritchie. It’s for system programming. C has low-level memory access, basic keywords, good…

    1 min read
  • C Language Introduction

    C is a programming language developed by Dennis Ritchie in 1972. It has a significant historical impact. It was originally created at Bell Laboratories of AT&T Labs for…

    4 min read
  • Code editors

    Code editors are where programmers spend most of their time. There are two main types of code editors: IDEs and Lightweight editors. IDEs (Integrated Development Environments) IDEs (Integrated…

    1 min read