Let us learn C in Code _data type

We have declared two types of data , the integer and float, but actually C language supports three data types. 

0) As integer(int) and float(float) are belong to the fundamental data type. Except for the integer(int) and float(float) ,there are character(char),double precision floating point(double). As the table below shows the basic data types.

----------

int 

char

float

double

----------

1)Derived data types,these type is combined with other keywords like signed, unsigned, short,long etc. The derived data types expends the data types ,and the variable is declared can hold difference numbers.Before list these derived data types, we should know Machine type, as actually , my pc belongs to 32-bit type machine.Do you get it?Our computer just know binary  and only know the binary , all the information store in computer are binary, and each bit can but only can hold one of the two opponent signals ,0 and 1. Which really looks like our human society , man or woman , girl or boy, yes or no, speak or shut up.  32-bit can hold how many status, this maybe a mathematical problem, actually 32 powers of 2. Now let us look at the derived data types, they are as follows:

signed char

unsigned char 

signed int

unsigned int

short int

signed short int

unsigned short int

signed long int

unsigned long  int

There maybe more than these types, but it really dosen't  matter ,all our chapters goes on , we will learn all of them in code gradually.

2)User defined data types, these types related with the structure and declaration keyword is struct, but as the newer to the C language, these user defined data types will be introduced to you lately. Here , you and me just need to know that. This data types existence ,more than that these types are surely important. As some software engineers said "Program are the data structure and algorithms!". 


Before finish this article , that solve a problem ,  please write an program to caculate  the result,  equation like this " y = x^2 + 2x + 1  ", each time you enter a number then y is the result, any data type is ok.

Time limited , have a nice day everyone!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章