栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

全网最全C语言数据类型讲解

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

全网最全C语言数据类型讲解

一、c语言的类型

1、(1)内置类型:int

                                char

                                short

                                long

                                flioat

                               double

                                ···

     (2)自定义类型: 即是构造类型

2、整型家族

(1)char类型:unsigned char

                         signed char

    notes: 1、为何char类型属于整型家族呢? 因为char在内从中存储是使用ASCLL值的,因此                            char类型属于整型家族。

               2、char ≈ signed char/ unsigned char是取决于编译器的,但大部分的编译器                                         char≈signed char

(2)short  (int)类型:unsigned short (int)

                                    signed short (int)

    notes: 1、short ≈ signed short

 (3) int 类型:unsigned int

                      signed int

    notes: 1、int ≈ signed int

 (4) long 类型: unsigned long (int)

                          long (int)

    notes: 1、long ≈ signed long

3、浮点型家族

  (1) float 单精度

  (2) double 双精度

4、构造类型

  (1) 数组类型

为合成数组类型为构造类型呢? int a[5] 的类型是:int [5]       int a[10] 的类型是:int [10]

int [5] 与 int [10] 的类型是不一样的,因此把数组类型归为构造类型

  (2) 结构体类型 struct

  (3) 枚举类型  enum

  (4) 联合类型  union

5、指针类型

char* p   int* p  float* p   void* p(无具体类型的指针)

6、空类型

notes:1、当所写的函数定义为(1)时,(3)、(4)两种形式都可以打印出hehe

             2、当所写函数定义为(2)时,(3)形式可以打印出hehe,但(4)形式便会报错

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/629596.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号