Data Types in C - Part 1 | C Language Tutorial | Mr. Srinivas

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to nourish technologies this is Wayne was in the last session we discussed about a variables concept now in this session we are going to discuss about datatypes the concept is a data types first of all what is a data type in the Declaration of every variable it is mandatory to specify its data type if you just look at the syntax of the variable you will understand right just this is a declaration right of a variable the syntax here it is in the Declaration of variable this is identifier and next what is important the data type is important data type the data type and identifier if you see the example data type is an integer and variable name is a variable name is a and here it is a data type what is a data type it is just a representation of data clearly how much memory write is required to allocate and what type of data is allowed to store so these two so will represent it by the data type of a specific variable suppose here it is I am declaring a variable a is of type wat integer type so here a gets memory allocation at some location at some location this is memory address we already discussed a memory address is a positive integer value positive integer value this is called address right every variable that gets memory allocation and how many bytes required generally integer occupies 2 bytes memory integer occupies 2 bytes memory and here it is once the variable is ready once the variable is ready and what type of data is allowed suppose here it is I am storing - 13 is a negative integer of course it is an integer so it is allowed and next one some positive integer 17 I am storing it is also allowed but can we store 3 4.56 no it will not allow decimal values not allowed simply datatype represents two things about a variable first one what type of data is allowed to store and second one how much memory is required to store the data these two things so described by a data type and now how many types are available in a c language okay see here it is data types classified into three types classified into three types this is a classification so first one primitive data types second one derived data types third one user defined data types data types classified into three types first one is a primitive data types second one is a derived data types third one is a user-defined data types right here it is a primitive data types integer character float void all these are called primitive data types these are comes under primitive types what are the derived types suppose array string pointer all these are comes under derived data types and what are the user-defined data types here it is structure Union type def enum all these are comes under user-defined data types so once again data types divided into three types classified into three types first one primitive data types integer character float void second one is a derived data types arrays strings pointers functions and all these are comes under derived data types and what are the user-defined data types structures unions type def innum so this is called classification and here either derived data types or user-defined data types these data types discussion later so because arrays fear we will discuss very clearly as a concept and strings also we will discuss structures unions all these are separate concepts in a c language so data types means only just these primitive data types discussion so first primitive types again subdivided into so many data types right so what are the types we'll see okay right so sub classification of primitive data types here primitive types only and what are the primitive types once again we are writing in TZ next one character next one float and the last one is a wide so these are the primitive types and what are the integer types integer divided into three types first one is a short second one is a integer third one is a long first one is a short type second one is a integer third one is a long and again short data type divided into two types one is a signed short second one is a unsigned short integer also one is a signed integer second one is a unsigned integer long also one is a signed long second one is a unsigned long so one integer data type again subdivided into six types sir wiser suppose if you want to store one integer value right one integer data type is enough now why these many data types are required why these many data types are required why again classified into six types depends on the data we are storing depends on the size of the data I just want to store the balance in account five thousand six thousand then we choose one particular type for example Department number so mostly thirty ten twenty Department numbers are they all right to store such type of data so very unless integer is enough for example shot this consider I am trying to store a phone number or I am trying to store account number right such type of things we can store with the help of only long integer types only depends on the size of the data right we choose a particular datatype right among available for example suppose 10 to soar the value 10 1 byte memory is in a one byte memory so always we should go for a datatype which occupies only one byte memory suppose if you are trying to choose a a datatype which occupies 4 bytes wantedly you are wasting 3 bytes memory in your application 3 bytes of memory we are wasting so that reduces the application performance so that is why always depends on the data we are using or we are storing right we should select a particular datatype suppose I am storing a phone number or n storing an account number then we should go for the data type which occupies 4 bytes memory because one byte memory is not enough to store such type of informations so this is integer types and how to select a particular type and why they divided one integer type into 6 sub classifications and next character character also divided into two types one is assigned character and second one is a unsigned character one is assigned and second one is an unsigned character an x one float divided into three types one is a flow type second one is a double and the last one is a long double last one is long double so these are the classifications wide just it is representing nothing and more clearly once already we discussed and once again we will see more briefly in a functions concept so here it is a three types three types again subdivided into so total how many types eleven types so this is called a sub classification of datatypes sub classification of data types and after that how many bytes each data type occupies how many bytes each data type occupies see suppose if it is a short integer either it is a signed integer or it is an unsigned integer it occupies two bytes memory in the program two bytes memory in the application and suppose if it is an integer right either it is assigned or in unsigned it will occupy two or four bytes sir when it will occupy two bytes and when it will occupy four bytes that is depends on the compiler we are using that once again we will see briefly right when we are going to discuss about a integer data type particularly okay and next long right either signed or unsigned it occupies 4 bytes memory once again short data type either it is a signed or unsigned again questions are what is assigned and what is unsigned simple signed means using signed data type we can store a positive value or negative value both are allowed in our program always we are not working with only positive values now in some of the cases definitely there is a requirement will come that we have to store negative values also in that situation we should go for sign D type because the scienter data type accept both a positive value and a negative value but suppose if it is a unsigned type unsigned strictly it will accept only positive values negative values it will not accept all right so this is a difference between sign datatype and unsigned datatype here it is short either it is a signed or unsigned it occupies two bytes integer either signed or unsigned it occupies 2 or 4 bytes depends on the compiler we are using and if it is a long it occupies 4 bytes character either signed care or unsigned care it will occupy only one byte memory it will occupy only one byte memory and next one float data type occupies 4 bytes double data type occupies 8 bytes long double data type occupies 10 bytes memory in the application right so these are the different sizes occupied by all these are classifications ok so this is all about a sub classification of data types and briefly exactly so what are the values we can store into short type character type integer type and flow type one by one we'll see in the coming sessions ok so this is the introduction part of a data types thank you thank you for watching for more videos please subscribe to nourish ID
Info
Channel: Naresh i Technologies
Views: 889,743
Rating: 4.8842511 out of 5
Keywords: C Language, Srinivas, Data Types in C Language, Naresh IT, C Language Demo, C Language Tutorial, Data Types, Data Types in C, data types in c language, What are the five data types, What is an integral data type, What are the basic data types of C programming language, basic data types of C, data types of C, different types of data types, data types in c programming, types of data types in c, different types of data types in c
Id: j1u3V6pzwEI
Channel Id: undefined
Length: 13min 30sec (810 seconds)
Published: Wed Sep 07 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.