Let us learn C in Code <4> _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!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值