Home » Computer Basics

What is Data Type in Computer programming languages?

Learn: What are the data types in computer programming languages, what are the workings of the data types and what they tell to the compiler?

In computer programming languages, a data type defines the type or/and behaviour of a data, it tells to the compiler about the type of data which is going to be stored and the compiler reserves the fixed number of bytes for that particular variable/constant.

Thus, we can say that, a data type defines two things:

  1. Type of data
  2. Memory blocks to be reserved for the data

Let suppose, In C programming language, there is a variable declared and defined like this: int x=10; This statement will tell to the compiler to reserve 2/4 bytes (depending on the compiler architecture) bytes in the computer memory for variable x and restrict to those memory blocks to accept only integer values.

Example: C language data types: int, float, char, struct, union etc


There are basically two types of data types in most of the computer programming languages:

  1. Basic/primitive data types
    These are the most basic data types to store basic values like integer, character, float, Boolean (in C++, java and other programming languages).
  2. Derived/non-primitive data types
    These are the data types, which are created with the help of basic data types like structures, arrays, union in C language.




Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.



Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.