c#访问修饰符修饰无效

Data Types In C

C中的数据类型

C中的数据类型 (Data Types in C)

C has various data types to store data in program. C program can store integer, decimal number, character(alphabets), string(words or sentence), list etc. using various data types.

C具有各种数据类型以将数据存储在程序中。 C程序可以使用各种数据类型存储整数,十进制数字,字符(字母),字符串(单词或句子),列表等。

We need to specify the data type of variable(identifier) to store any data in it.

我们需要指定变量(标识符)的数据类型以在其中存储任何数据。

Explanation and basic usage of the concept is provided below. Data types and Modifiers have significant in-depth technical details which are not covered in this article.

下面提供了该概念的说明和基本用法。 数据类型和修饰符具有重要的深入技术细节,本文未涉及。

There are 2 categories of Data Types in C:

C中有2类数据类型

1.原始(原始)数据类型 (1. Primitive (Primary) Data Types)

These data types store fundamental data used in the C programming.

这些数据类型存储C编程中使用的基本数据。

  1. int整型
  2. It is used to store integer values. C program compiled with GCC compiler (32-Bit) can store integers from -2147483648 to 2147483647. The size of int is compiler dependent. It takes 4 bytes in a 32-bit compiler such as GCC.

    它用于存储整数值。 使用GCC编译器(32位)编译的C程序可以存储从-2147483648到2147483647的整数。int的大小取决于编译器。 在32位编译器(例如GCC)中,它占用4个字节。

    int myIntegerValue = 100;
  3. char烧焦
  4. It stores single character such as ‘a’, ‘Z’, ‘@’ etc. including number, symbol or special character. It takes 1 byte (8-bits) to store each character.

    它存储单个字符,例如“ a”,“ Z”,“ @”等,包括数字,符号或特殊字符。 存储每个字符需要1个字节(8位)。

    char myCharacter = 'A';

    Note: Every character has a corresponding ASCII value to it ranging from -128 to 127. Numbers as a character has their corresponding ASCII values too. For example, ‘1’ as char has ASCII value 49, ‘A’ has ASCII value 65.

    注意 :每个字符都有一个对应的ASCII值,范围从-128到127。数字作为字符也有其对应的ASCII值。 例如,作为char的'1'具有ASCII值49,'A'具有ASCII值65。

  5. float浮动
  6. It stores real numbers with precision upto 6 decimal places. It takes 4 bytes of memory and is also known as floating point number.

    它存储的实数精度高达6位小数。 它占用4个字节的内存,也称为浮点数。

    float myFloatingValue = 100.6543;
  7. double
  8. It stores real numbers with precision upto 15 decimal places. It takes 8 bytes of memory.

    它以高达15位小数的精度存储实数。 它占用8个字节的内存。

    double myDoubleValue = 180.715586;

2.派生和用户定义的数据类型 (2. Derived and User Defined Data Types)

These are made by collection or combination of primitive data types and hence known as derived data types. Details will be covered in the articles dedicated to each topic of the following:

这些是通过原始数据类型的收集或组合制成的,因此称为派生数据类型。 有关以下每个主题的文章将介绍详细信息:

  • Array数组
  • Structure结构体
  • Union联盟
  • Enum枚举
  • Pointer指针

C中的修饰符 (Modifiers in C)

These are keywords in C to modify the default properties of int and char data types. There are 4 modifiers in C as follows.

这些是C中的关键字,用于修改int和char数据类型的默认属性。 C中有4个修饰符,如下所示。

Modifiers In C

C中的修饰符

  1. short
  2. It limits user to store small integer values from -32768 to 32767. It can be used only on int data type.

    它限制用户存储从-32768到32767的小整数值。它只能在int数据类型上使用。

    short int myShortIntegerValue = 18;
  3. long
  4. It allows user to stores very large number (something like 9 Million Trillion) from -9223372036854775808 to 9223372036854775807. Syntax “long long” is used instead of “long int”.

    它允许用户存储从-9223372036854775808到9223372036854775807的非常大的数量( 大约 900万亿美元 )。 使用语法“ long long”代替“ long int”。

    long long myLongIntegerValue = 827337203685421584;
  5. signed
  6. It is default modifier of int and char data type if no modifier is specified. It says that user can store negative and positive values.

    如果未指定修饰符,则它是int和char数据类型的默认修饰符。 它表示用户可以存储负值和正值。

    signed int myNegativeIntegerValue = -544;
    signed int mypositiveIntegerValue = 544;
    /* Both of the statements have same meaning even without "signed" modifier*/
  7. unsigned未签名
  8. When user intends to store only positive values in the given data type (int and char).

    当用户打算仅在给定数据类型(int和char)中存储正值时。

    unsigned int myIntegerValue = 486;

摘要 (Summary)

It is important to understand the basic usage of data types to code and develop logic. There is a lot more about data types, however, you can easily proceed in your journey to C programming with the information provided.

理解数据类型的基本用法以进行编码和开发逻辑很重要。 有关数据类型的更多信息,但是,您可以使用提供的信息轻松地进行C编程。

翻译自: https://www.journaldev.com/26779/data-types-and-modifiers-in-c

c#访问修饰符修饰无效

c#访问修饰符修饰无效_C中的数据类型和修饰符相关推荐

  1. c语言中浮点数和整数转换_C中的数据类型-整数,浮点数和空隙说明

    c语言中浮点数和整数转换 C中的数据类型 (Data Types in C) There are several different ways to store data in C, and they ...

  2. c ++基本数据类型_C ++中的数据类型

    c ++基本数据类型 Data types help the associated variables understand the type of data they can store into ...

  3. excel 替换 换行符_在Excel中查找和替换换行符

    excel 替换 换行符 When you want to create a line break (line feed) in a cell, you press Alt + Enter, to s ...

  4. java不可以修改的修饰语,在Java程序中,用关键字_修饰的常量对象创建后就不能再修改了。...

    [判断题]工程经济分析评价时只考虑给项目投资人带来的经济效果( ) [判断题]车床夹具设计之前必须对零件进行工序分析. [判断题] [单选题]儒家思想不包含( ) [单选题]导致上海租界由" ...

  5. c语言地址符作用,C语言中指针和取地址符的关系

    一 概念定义: 严格说起来,应该这么讲:指针存的是地址,而&运算符是取变量的地址. 指针原理: 其实计算机中的内存就像一个个抽屉(一兆内存就相当于1百万个抽屉),每个抽屉都有一个编号,用于存放 ...

  6. java中的标识符和关键字_浅谈java中的标识符、修饰符和关键字

    合法标识符 Java语言中,对于变量,常量,函数,语句块均有名字,我们统统称之为Java标识符.标识符是用来给类.对象.方法.变量.接口和自定义数据类型命名的. 组成:Java标识符由数字,字母和下划 ...

  7. java域的控制修饰符可分为_Java中的类和方法的修饰符

    java 中的类和方法的修饰符Java程序在定义类时,除了使用class关键字标识之外,还可以在class之前增加若干类的修饰符来修饰限定所定义的类的特性.类的修饰符分为访问控制符和非访问控制符两大类 ...

  8. 二十五、深入Java中的static静态修饰符

    @Author:Runsen @Date:2020/6/2 作者介绍:Runsen目前大三下学期,专业化学工程与工艺,大学沉迷日语,Python, Java和一系列数据分析软件.导致翘课严重,专业排名 ...

  9. Java final修饰符的作用,Java中的final修饰符

    1.什么时候可以选择final修饰符 如果想让一个类不被其他类继承,不允许在有子类,这时候就要考虑用到final来修饰. 2.用final修饰的类 首先大家要明白,用final修饰的类是不能被继承的, ...

最新文章

  1. AI时代人类需要具备的九种软技能,你get了几个?
  2. 机器人瓦力 配乐_《WALL-E》机器人小王子
  3. TypeError系列之:TypeError: only size-1 arrays can be converted to Python scalars
  4. 使用 Mesos 管理虚拟机
  5. 在java程序中定义的类有两种成员_java试题 急需答案 谢谢!!!
  6. fcm 服务器接入 golang_Golang 写的即时通讯服务器 im(服务组件形式)
  7. 万字详解|手撕 9大排序算法!
  8. c++求n的几次方_数理统计|笔记整理(E)——Ch7-C习题课
  9. 如何在三层交换机上实现跨VLAN 的DHCP配置
  10. mysql交互式连接非交互式连接
  11. 在线vim配色加term与gui统一颜色调整python脚本
  12. 【恩智浦杯(飞思卡尔)全国大学生智能汽车竞赛】解读部分北科技术报告图像处理内容(点到为止)
  13. 恢复chrome浏览器书签
  14. linux终端串口调试(RS232 serial ttyS)
  15. VSCode快速生成HTML基础模板--输入!一键快捷生成--无法自动生成的解决办法
  16. 利用开源软件 Hugin 实现照片的景深合成
  17. 视频教程-①Spring Cloud 第一季(初级入门篇)-Java
  18. 身为程序员,我敢和你打赌100块,这个数学符号你根本不会认不会写
  19. 2019-07-09 函数的基本使用和参数
  20. PPT设计:PPT封面页9种设计布局/思维

热门文章

  1. ZC_汇编指令_cmp
  2. nodejs初探(四)实现一个多人聊天室
  3. 【转】深入理解JVM—JVM内存模型
  4. win7安装证书时无响应的解决办法
  5. 网上Silverlight项目收集
  6. [转载] python数学计算模块之math常用函数学习使用
  7. 09-Python入门学习-函数基础与参数
  8. typescript类与继承
  9. MySQL5.7 踩坑实录
  10. python3,进程间的通信