{"id":80942,"date":"2021-06-11T09:00:10","date_gmt":"2021-06-11T03:30:10","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=80942"},"modified":"2021-06-11T09:00:10","modified_gmt":"2021-06-11T03:30:10","slug":"data-types-in-c","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/","title":{"rendered":"Data Types in C"},"content":{"rendered":"<p><span style=\"font-weight: 400\">Data types provide a valuable role to declare variables or functions of different types in all programming languages.<\/span><\/p>\n<p><span style=\"font-weight: 400\">1. If you provide the data type then based on your data type, it makes it easy to return the value of a function.<\/span><\/p>\n<p><span style=\"font-weight: 400\">2. It helps a lot when you declare a variable. It becomes easy to differentiate within the data types.<\/span><\/p>\n<h3>What are Data Types in C?<\/h3>\n<p><span style=\"font-weight: 400\">Data types provide a helping hand to the compiler by checking which type of data is being entered by the programmer. C programming language makes it easy for a programmer to use various types of data in their programs.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">These are the following data types in C:-\u00a0<\/span><\/p>\n<p>1. <strong>Basic Data Type:<\/strong>&#8211; <span style=\"font-weight: 400\">It includes integer types and floating-point types.<\/span><\/p>\n<p>2<strong>. Enumeration Data Type<\/strong>:- <span style=\"font-weight: 400\">They are used for defining a variable that can only assign separate integer values.<\/span><\/p>\n<p>3. <strong>Void Data Type:<\/strong>&#8211;<span style=\"font-weight: 400\"> If you see the type is <\/span>void<span style=\"font-weight: 400\"> then it means that no value is available.<\/span><\/p>\n<p>4. <strong>Derived Data Type:<\/strong>&#8211;<span style=\"font-weight: 400\"> Further categorized into pointer types, array types, structure types, union types etc.<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Types<\/b><\/td>\n<td><b>Data Types<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Basic Data Type<\/span><\/td>\n<td><span style=\"font-weight: 400\">int, char, float, double<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Derived Data Type<\/span><\/td>\n<td><span style=\"font-weight: 400\">array, pointer, structure, union<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Enumeration Data Type<\/span><\/td>\n<td><span style=\"font-weight: 400\">enum<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Void Data Type<\/span><\/td>\n<td><span style=\"font-weight: 400\">void<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>C Data Types<\/h3>\n<p><span style=\"font-weight: 400\">In the C programming language, various types of data are available.\u00a0<\/span><\/p>\n<p>1. Primitive data types<\/p>\n<p>2. User-defined data types<\/p>\n<p>3. Derived data types<\/p>\n<p>Below are the examples of some common data types used in C:<\/p>\n<p>1. int <span style=\"font-weight: 400\">(for integer data)<\/span><\/p>\n<p>2. char <span style=\"font-weight: 400\">(for character data)<\/span><\/p>\n<p>3. float <span style=\"font-weight: 400\">(for floating point numbers)<\/span><\/p>\n<p>4. double <span style=\"font-weight: 400\">(double precision floating point numbers)<\/span><\/p>\n<p>5. void<\/p>\n<p><span style=\"font-weight: 400\">These data types have different ranges up to which they can store numbers. In addition to these data types, there are few more data types available in the C++ programming language:-<\/span><\/p>\n<p>1. bool:- It is a boolean value. It can be either true or false.<\/p>\n<p>2. wchar_t:- It is more like the character data type. But it is a wide character. The purpose of this data type is to represent characters which require more memory.<\/p>\n<p>3. string:- String is generally a sequence of characters. And it is also a data type.<\/p>\n<h4>1. Integer Data Types in C<\/h4>\n<p>int means Integer. Integers can have positive or negative values but no decimal values. For declaring integer variables, use int.<\/p>\n<p>For Example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int age;<\/pre>\n<p>Syntax for declaring multiple variables:-<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int age,number;<\/pre>\n<table>\n<tbody>\n<tr>\n<td><b>Type<\/b><\/td>\n<td><b>Range<\/b><\/td>\n<td><b>Format Specifier<\/b><\/td>\n<td><b>Size<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">int<\/span><\/td>\n<td><span style=\"font-weight: 400\">-2,147,483,648<\/span><\/p>\n<p><span style=\"font-weight: 400\">to 2,147,483,647<\/span><\/td>\n<td><span style=\"font-weight: 400\">%d<\/span><\/td>\n<td><span style=\"font-weight: 400\">at least 2, usually 4<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">short int<\/span><\/td>\n<td><span style=\"font-weight: 400\">-32,768 to 32,767<\/span><\/td>\n<td><span style=\"font-weight: 400\">%hd<\/span><\/td>\n<td><span style=\"font-weight: 400\">2<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">unsigned int<\/span><\/td>\n<td><span style=\"font-weight: 400\">0 to 4,294,967,295<\/span><\/td>\n<td><span style=\"font-weight: 400\">%u<\/span><\/td>\n<td><span style=\"font-weight: 400\">at least 2, usually 4<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">long int<\/span><\/td>\n<td><span style=\"font-weight: 400\">-2,147,483,648 to 2,147,483,647<\/span><\/td>\n<td><span style=\"font-weight: 400\">%ld<\/span><\/td>\n<td><span style=\"font-weight: 400\">at least 4, usually 8<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">long long int<\/span><\/td>\n<td><span style=\"font-weight: 400\">-(2^63) to (2^63)-1<\/span><\/td>\n<td><span style=\"font-weight: 400\">%lld<\/span><\/td>\n<td><span style=\"font-weight: 400\">at least 8<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">unsigned long int<\/span><\/td>\n<td><span style=\"font-weight: 400\">0 to 4,294,967,295<\/span><\/td>\n<td><span style=\"font-weight: 400\">%lu<\/span><\/td>\n<td><span style=\"font-weight: 400\">at least 4<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">unsigned long long int<\/span><\/td>\n<td><span style=\"font-weight: 400\">0 to 18,446,744,073,709,551,615<\/span><\/td>\n<td><span style=\"font-weight: 400\">%llu<\/span><\/td>\n<td><span style=\"font-weight: 400\">at least 8<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">signed int<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u221232,768 to 32,767<\/span><\/td>\n<td><span style=\"font-weight: 400\">%d<\/span><\/td>\n<td><span style=\"font-weight: 400\">2 bytes<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">signed short int<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u221232,768 to 32,767<\/span><\/td>\n<td><span style=\"font-weight: 400\">%d<\/span><\/td>\n<td><span style=\"font-weight: 400\">2 bytes<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">unsigned short int<\/span><\/td>\n<td><span style=\"font-weight: 400\">0 to 65,535<\/span><\/td>\n<td><span style=\"font-weight: 400\">%hu<\/span><\/td>\n<td><span style=\"font-weight: 400\">2 bytes<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">signed long int<\/span><\/td>\n<td><span style=\"font-weight: 400\">-2,147,483,648 to 2,147,483,647<\/span><\/td>\n<td><span style=\"font-weight: 400\">%ld<\/span><\/td>\n<td><span style=\"font-weight: 400\">4 bytes<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">short<\/span><\/td>\n<td><span style=\"font-weight: 400\">-32,768 to 32,767<\/span><\/td>\n<td><\/td>\n<td><span style=\"font-weight: 400\">2 bytes<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">long<\/span><\/td>\n<td><span style=\"font-weight: 400\">-9223372036854775808 to 9223372036854775807<\/span><\/td>\n<td><span style=\"font-weight: 400\">%ld<\/span><\/td>\n<td><span style=\"font-weight: 400\">8 bytes<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">unsigned long<\/span><\/td>\n<td><span style=\"font-weight: 400\">0 to 18446744073709551615<\/span><\/td>\n<td><span style=\"font-weight: 400\">%u<\/span><\/td>\n<td><span style=\"font-weight: 400\">8 bytes<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>2. Floating data types in C<\/h4>\n<p><span style=\"font-weight: 400\">The purpose of<\/span> float <span style=\"font-weight: 400\">data type in C is to hold real numbers.<\/span><\/p>\n<p>Syntax for declaring a float variable:-<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">float ratio;<\/pre>\n<p><span style=\"font-weight: 400\">To know more about the Integer types, take a look at the following table.<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Type<\/b><\/td>\n<td><b>Size<\/b><\/td>\n<td><b>Format Specifiers<\/b><\/td>\n<td><b>Range of Value<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">float<\/span><\/td>\n<td><span style=\"font-weight: 400\">4 byte<\/span><\/td>\n<td><span style=\"font-weight: 400\">%f<\/span><\/td>\n<td><span style=\"font-weight: 400\">1.2E-38 to 3.4E+38<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">double<\/span><\/td>\n<td><span style=\"font-weight: 400\">8 byte<\/span><\/td>\n<td><span style=\"font-weight: 400\">%lf<\/span><\/td>\n<td><span style=\"font-weight: 400\">2.3E-308 to 1.7E+308<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Long double<\/span><\/td>\n<td><span style=\"font-weight: 400\">10 byte<\/span><\/td>\n<td><span style=\"font-weight: 400\">%Lf<\/span><\/td>\n<td><span style=\"font-weight: 400\">3.4E-4932 to 1.1E+4932<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The difference between float and double is that the size of float is 4 bytes and the size of double is 8 bytes.<\/p>\n<h4>3. Character Data Types in C<\/h4>\n<p>The purpose of these data types is to store single characters. The size of char is 1 bytes.<\/p>\n<p>Syntax for declaring:-<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">char TechVidvan = 'D';<\/pre>\n<p><span style=\"font-weight: 400\">Following is the table to know more about the character data types.<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Type<\/b><\/td>\n<td><b>Size<\/b><\/td>\n<td><b>Format Specifiers<\/b><\/td>\n<td><b>Range of Value<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">char<\/span><\/td>\n<td><span style=\"font-weight: 400\">1 byte<\/span><\/td>\n<td><span style=\"font-weight: 400\">%c<\/span><\/td>\n<td><span style=\"font-weight: 400\">-128 to 127 or 0 to 255<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">signed char<\/span><\/td>\n<td><span style=\"font-weight: 400\">1 byte<\/span><\/td>\n<td><span style=\"font-weight: 400\">%c<\/span><\/td>\n<td><span style=\"font-weight: 400\">-128 to 127<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">unsigned char<\/span><\/td>\n<td><span style=\"font-weight: 400\">1 byte<\/span><\/td>\n<td><span style=\"font-weight: 400\">%c<\/span><\/td>\n<td><span style=\"font-weight: 400\">0 to 255<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h5>a.\u00a0 Short and long Data Types in C<\/h5>\n<p><span style=\"font-weight: 400\">Suppose, a programmer wants to use large numbers on their code then they can use the type specifier named <\/span>long.<\/p>\n<p><strong>Syntax of long:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">long j; \/\/ for storing integer values\nlong long o; \/\/ for storing integer values\nlong double p; \/\/ for storing floating point values<\/pre>\n<p>But if you want to use small integer numbers then you can use a short type specifier.<\/p>\n<p><strong>Syntax of short:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">short a;<\/pre>\n<h5>b. signed and unsigned Data types in\u00a0 C<\/h5>\n<p>With signed and unsigned type modifiers, a programmer can modify the data storage of a data type.<\/p>\n<p><strong>Syntax:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">unsigned int b;\nint a;<\/pre>\n<p>We already know that the size of int is 4 bytes. And the variable a can hold values from -2,147,483,648 to 2,147,483,647. But variable b can hold values from 0 to 4,294,967,295.<\/p>\n<h3>User-Defined Data Types in C<\/h3>\n<p>1. <strong>Structure<\/strong>:- To declare a structure variable, use the struct keyword. It stores different data types. A way to combine data of different types.<\/p>\n<p>2. <strong>Enum<\/strong>:- To define enums, use the enum keyword. It consists of integer values.<\/p>\n<p>3. <strong>Union<\/strong>:- Union is like Structure. But union uses less memory. It stores a package of different types of data.<\/p>\n<h3>Derived Data Types in C<\/h3>\n<p>1. <strong>Arrays<\/strong>:- Arrays store multiple items of the same data type. It is a collection of items stored at contiguous memory locations.<\/p>\n<p>2. <strong>Pointers<\/strong>:- A powerful feature of c. It helps in accessing the memory and their addresses on the memory.<\/p>\n<p>3. <strong>References<\/strong>:- Mainly used to return the pointer address of the variable.<\/p>\n<p>4. <strong>Functions<\/strong>:- C programming language gives many built-in functions like printf(), scanf() etc. But you can also create your own function. It is a group of statements to perform specific tasks.<\/p>\n<h3>Void Data Type in C<\/h3>\n<p>It means no value available. The use of this data type is to assign null or no return value while declaring a function.<\/p>\n<h4>Variable Declaration in C<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\nint main()\n{\n    int a = 1337; \/\/ Declaring Integer type Variable\n    float b = 65.24; \/\/ Declaring float type Variable\n    char ex = 'T'; \/\/ Declaring char type Variable\n    long d = 41657; \/\/ Declaring long +ve integer type Variable\n    long e = -21556; \/\/ Declaring long -ve integer type Variable\n}<\/pre>\n<h4>Size of Operator in C<\/h4>\n<p>If you want to check the size of data types available in C then you can do it by using sizeof() operator. Below is the code to show the storage sizes of int, char and float data types.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\nint main()\n{\n  printf(\"Sizes of int, char and float...\\n\");\n  printf(\"int is: %d bytes\\n\", sizeof(int));\n  printf(\"char is: %d bytes\\n\", sizeof(char));\n  printf(\"float is: %d bytes\\n\", sizeof(float));\n  return 0;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Sizes of int, char and float&#8230;<br \/>\nint is: 4 bytes<br \/>\nchar is: 1 bytes<br \/>\nfloat is: 4 bytes<\/div>\n<p>Below is an example of a code of primary data types in C.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include&lt;stdio.h&gt;\n\nint main()\n{\n  int num = 20;\n  long int num1 = 455;\n  char char1 = 'H';\n  signed char char2 = 'J';\n  unsigned char char3 = 'I';\n  float d1 = 25.1;\n  double d2 = 9.4777;\n  printf(\"\\n\");\n  printf(\"Welcome to TechVidvan Tutorial on Data Types of C...\\n\\n\");\n  printf(\"Size of int data type %d is: %d bytes.\\n\", num,sizeof(num));\n  printf(\"Size of long int data type %d is: %d bytes.\\n\", num1,sizeof(num1));\n  printf(\"Size of char data type %c is: %d bytes.\\n\", char1,sizeof(char1));\n  printf(\"Size of signed char data type %c is: %d bytes.\\n\", char2,sizeof(char2));\n  printf(\"Size of unsigned char data type %c is: %d bytes.\\n\", char3,sizeof(char3));\n  printf(\"Size of float data type %f is: %d bytes.\\n\", d1,sizeof(d1));\n  printf(\"Size of double data type %f is: %d bytes.\\n\", d2,sizeof(d2));\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Welcome to TechVidvan Tutorial on Data Types of C&#8230;Size of int data type 20 is: 4 bytes.<br \/>\nSize of long int data type 455 is: 8 bytes.<br \/>\nSize of char data type H is: 1 bytes.<br \/>\nSize of signed char data type J is: 1 bytes.<br \/>\nSize of unsigned char data type I is: 1 bytes.<br \/>\nSize of float data type 25.100000 is: 4 bytes.<br \/>\nSize of double data type 9.477700 is: 8 bytes.<\/div>\n<h3>Format Specifier in C<\/h3>\n<p><span style=\"font-weight: 400\">The purpose of format specifiers is for I\/O operations. A programmer can read data from the user using scanf() function and also he can print the data using printf() function.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Below is the list of format specifiers:-<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Format Specifier<\/b><\/td>\n<td><b>Type<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%c<\/span><\/td>\n<td><span style=\"font-weight: 400\">Character<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%d<\/span><\/td>\n<td><span style=\"font-weight: 400\">Signed integer<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%e or %E<\/span><\/td>\n<td><span style=\"font-weight: 400\">Scientific notation of floats<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%f<\/span><\/td>\n<td><span style=\"font-weight: 400\">Float values<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%g or %G<\/span><\/td>\n<td><span style=\"font-weight: 400\">Similar as %e or %E<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%hi<\/span><\/td>\n<td><span style=\"font-weight: 400\">Signed integer (short)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%hu<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsigned Integer (short)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%i<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsigned integer<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%l or %ld or %li<\/span><\/td>\n<td><span style=\"font-weight: 400\">Long<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%lf<\/span><\/td>\n<td><span style=\"font-weight: 400\">Double<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%Lf<\/span><\/td>\n<td><span style=\"font-weight: 400\">Long double<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%lu<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsigned int or unsigned long<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%lli or %lld<\/span><\/td>\n<td><span style=\"font-weight: 400\">Long long<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%llu<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsigned long long<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%o<\/span><\/td>\n<td><span style=\"font-weight: 400\">Octal representation<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%p<\/span><\/td>\n<td><span style=\"font-weight: 400\">Pointer<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%s<\/span><\/td>\n<td><span style=\"font-weight: 400\">String<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%u<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsigned int<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%x or %X<\/span><\/td>\n<td><span style=\"font-weight: 400\">Hexadecimal representation<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%n<\/span><\/td>\n<td><span style=\"font-weight: 400\">Prints nothing<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">%%<\/span><\/td>\n<td><span style=\"font-weight: 400\">Prints % character<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Summary<\/h3>\n<p><span style=\"font-weight: 400\">1. Based on the data type, one can analyze what type of data returned by the function.<\/span><\/p>\n<p><span style=\"font-weight: 400\">2. Different ranges and sizes for each data type.<\/span><\/p>\n<p><span style=\"font-weight: 400\">3. A constant is a value that stays the same at the time of execution.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Data types provide a valuable role to declare variables or functions of different types in all programming languages. 1. If you provide the data type then based on your data type, it makes it&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":81064,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3510],"tags":[3509,3511,3512,3513,3514],"class_list":["post-80942","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-programming","tag-basic-data-types-in-c","tag-data-types-in-c","tag-derived-data-types-in-c","tag-format-specifier-in-c","tag-void-data-type-in-c"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Data Types in C - TechVidvan<\/title>\n<meta name=\"description\" content=\"Data Types in C programming with examples. There are 4 types of data types in C: Basic Data Type, Derived Data Type, Enumeration, Void.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Data Types in C - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Data Types in C programming with examples. There are 4 types of data types in C: Basic Data Type, Derived Data Type, Enumeration, Void.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-11T03:30:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Data-Types-of-C.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Data Types in C - TechVidvan","description":"Data Types in C programming with examples. There are 4 types of data types in C: Basic Data Type, Derived Data Type, Enumeration, Void.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/","og_locale":"en_US","og_type":"article","og_title":"Data Types in C - TechVidvan","og_description":"Data Types in C programming with examples. There are 4 types of data types in C: Basic Data Type, Derived Data Type, Enumeration, Void.","og_url":"https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2021-06-11T03:30:10+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Data-Types-of-C.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Data Types in C","datePublished":"2021-06-11T03:30:10+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/"},"wordCount":1222,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Data-Types-of-C.jpg","keywords":["Basic data types in C","Data Types in C","Derived data types in C","Format Specifier in C","Void Data Type in C"],"articleSection":["C Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/","url":"https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/","name":"Data Types in C - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Data-Types-of-C.jpg","datePublished":"2021-06-11T03:30:10+00:00","description":"Data Types in C programming with examples. There are 4 types of data types in C: Basic Data Type, Derived Data Type, Enumeration, Void.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Data-Types-of-C.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Data-Types-of-C.jpg","width":1200,"height":628,"caption":"Data Types in C"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/data-types-in-c\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Data Types in C"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/80942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=80942"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/80942\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/81064"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=80942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=80942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=80942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}