Sizes of integer types 整形字节长度 系统字节
/usr/include/limits.h
/* Copyright (C) 1991, 1992, 1996, 1997, 1998, 1999, 2000, 2005
Free Software Foundation, Inc.
This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */ /*
* ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types <limits.h>
*/ #ifndef _LIBC_LIMITS_H_
#define _LIBC_LIMITS_H_ 1 #include <features.h> /* Maximum length of any multibyte character in any locale.
We define this value here since the gcc header does not define
the correct value. */
#define MB_LEN_MAX 16 /* If we are not using GNU CC we have to define all the symbols ourself.
Otherwise use gcc's definitions (see below). */
#if !defined __GNUC__ || __GNUC__ < 2 /* We only protect from multiple inclusion here, because all the other
#include's protect themselves, and in GCC 2 we may #include_next through
multiple copies of this file before we get to GCC's. */
# ifndef _LIMITS_H
# define _LIMITS_H 1 #include <bits/wordsize.h> /* We don't have #include_next.
Define ANSI <limits.h> for standard 32-bit words. */ /* These assume 8-bit `char's, 16-bit `short int's,
and 32-bit `int's and `long int's. */ /* Number of bits in a `char'. */
# define CHAR_BIT 8 /* Minimum and maximum values a `signed char' can hold. */
# define SCHAR_MIN (-128)
# define SCHAR_MAX 127 /* Maximum value an `unsigned char' can hold. (Minimum is 0.) */
# define UCHAR_MAX 255 /* Minimum and maximum values a `char' can hold. */
# ifdef __CHAR_UNSIGNED__
# define CHAR_MIN 0
# define CHAR_MAX UCHAR_MAX
# else
# define CHAR_MIN SCHAR_MIN
# define CHAR_MAX SCHAR_MAX
# endif /* Minimum and maximum values a `signed short int' can hold. */
# define SHRT_MIN (-32768)
# define SHRT_MAX 32767 /* Maximum value an `unsigned short int' can hold. (Minimum is 0.) */
# define USHRT_MAX 65535 /* Minimum and maximum values a `signed int' can hold. */
# define INT_MIN (-INT_MAX - 1)
# define INT_MAX 2147483647 /* Maximum value an `unsigned int' can hold. (Minimum is 0.) */
# define UINT_MAX 4294967295U /* Minimum and maximum values a `signed long int' can hold. */
# if __WORDSIZE == 64
# define LONG_MAX 9223372036854775807L
# else
# define LONG_MAX 2147483647L
# endif
# define LONG_MIN (-LONG_MAX - 1L) /* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */
# if __WORDSIZE == 64
# define ULONG_MAX 18446744073709551615UL
# else
# define ULONG_MAX 4294967295UL
# endif # ifdef __USE_ISOC99 /* Minimum and maximum values a `signed long long int' can hold. */
# define LLONG_MAX 9223372036854775807LL
# define LLONG_MIN (-LLONG_MAX - 1LL) /* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */
# define ULLONG_MAX 18446744073709551615ULL # endif /* ISO C99 */ # endif /* limits.h */
#endif /* GCC 2. */ #endif /* !_LIBC_LIMITS_H_ */ /* Get the compiler's limits.h, which defines almost all the ISO constants. We put this #include_next outside the double inclusion check because
it should be possible to include this file more than once and still get
the definitions from gcc's header. */
#if defined __GNUC__ && !defined _GCC_LIMITS_H_
/* `_GCC_LIMITS_H_' is what GCC's file defines. */
# include_next <limits.h>
#endif /* The <limits.h> files in some gcc versions don't define LLONG_MIN,
LLONG_MAX, and ULLONG_MAX. Instead only the values gcc defined for
ages are available. */
#if defined __USE_ISOC99 && defined __GNUC__
# ifndef LLONG_MIN
# define LLONG_MIN (-LLONG_MAX-1)
# endif
# ifndef LLONG_MAX
# define LLONG_MAX __LONG_LONG_MAX__
# endif
# ifndef ULLONG_MAX
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
# endif
#endif #ifdef __USE_POSIX
/* POSIX adds things to <limits.h>. */
# include <bits/posix1_lim.h>
#endif #ifdef __USE_POSIX2
# include <bits/posix2_lim.h>
#endif #ifdef __USE_XOPEN
# include <bits/xopen_lim.h>
#endif
/usr/include/linux/limits.h
#ifndef _LINUX_LIMITS_H
#define _LINUX_LIMITS_H #define NR_OPEN 1024 #define NGROUPS_MAX 65536 /* supplemental group IDs are available */
#define ARG_MAX 131072 /* # bytes of args + environ for exec() */
#define LINK_MAX 127 /* # links a file may have */
#define MAX_CANON 255 /* size of the canonical input queue */
#define MAX_INPUT 255 /* size of the type-ahead buffer */
#define NAME_MAX 255 /* # chars in a file name */
#define PATH_MAX 4096 /* # chars in a path name including nul */
#define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */
#define XATTR_NAME_MAX 255 /* # chars in an extended attribute name */
#define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */
#define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */ #define RTSIG_MAX 32 #endif
~
Sizes of integer types 整形字节长度 系统字节的更多相关文章
- C++中各种数据类型占据字节长度
准备校招笔试的时候经常遇到C++某个数据类型占据多少个字节的问题,查阅了下资料,总结如下: 首先罗列一下C++中的数据类型都有哪些: 1.整形:int.long 2.字符型:char.wchar_t ...
- c语言数据类型字节长度
突然间就想到了long和int到底什么区别(发现有很多问题都是突然间想到的),然后百度.google各种查找,各种书籍:<C++ Primer>.<C程序设计语言>查看,终于明 ...
- c++中各类型数据占据的字节长度
c++中各种类型数据类型占据字节长度 首先罗列一下C++中的数据类型都有哪些: 1.整形:int.long 2.字符型:char.wchar_t 3.布尔型:bool 4.浮点型:float.doub ...
- java String长度与varchar长度匹配理解(字符和字节长度理解)
java String长度与varchar长度匹配理解(字符和字节长度理解) string中的length()长度,返回的是char的数量,每个char可以存储世界上任何类型的文字和字符,一个char ...
- 升级d7的代码到2010以上版本注意事项(SetLength的参数就是字符长度,而不是字节长度,但Move函数要改)
delphi2010是delphi所有版本的分水岭,其中2010—xe10.2之间版本上的代码都有比较好的兼容性,基本上都能直接进行编译,不需要过多修改,但d7距d2010跨度4个版本以上,新版本除了 ...
- delphi按字节长度分割字符串函数(转)
此字符串分割函数用delphi编写,可以适应字符串中存在双字节字符和单字节字符. function TricheditEfm.SplitString(source:string;Sleng:Integ ...
- 请问utf-8的中文是一个汉字占三个字节长度吗?
这是个好问题,可以当作一个笔试题.先从字符编码讲起. 1.美国人首先对其英文字符进行了编码,也就是最早的ascii码,用一个字节的低7位来表示英文的128个字符,高1位统一为0: 2.后来欧洲人发现尼 ...
- js校验输入字符串的字节长度
//检查输入字符串字节长度 function fucCheckLength(strTemp) { var i,sum; sum=0; var length = strTemp.length ; for ...
- C#与JS实现 获取指定字节长度 中英文混合字符串 的方法
平时在作数据库插入操作时,如果用 INSERT 语句向一个varchar型字段插入内容时,有时会因为插入的内容长度超出规定的长度而报错. 尤其是插入中英文混合字符串时,SQL Server中一般中文要 ...
随机推荐
- flask 扩展包
1.pipenv install python-dotenv (管理项目环境变量): 2.pipenv install watchdog --dev(监测文件变动,一般开发时使用): 3.pipen ...
- c# Regex类
- Buffer Latch Timeout的解析
[问题描述] 我们可能会在数据库的错误日志里,发现这么一条信息: A time-out occurred while waiting for buffer latch -- type 4, bp 00 ...
- MySQL学习总结 (InnoDB)
主要内容: 存储结构 索引 锁 事务 存储结构 表 索引组织表:表是根据主键顺序组织存放的.如果表中没有非空惟一索引,引擎会自动创建一个6字节大小的指针. 主键的索引是定义索引的顺序,而不是建表时列的 ...
- win10 64下anaconda4.2.0(python3.5)
python环境:win10 64下anaconda4.2.0(python3.5).安装tensorflow过程是在Anaconda Prompt中进行安装 1:打开Anaconda Prompt ...
- linux的vim基本使用
转自:https://www.cnblogs.com/qq631243523/p/10191714.html 所有的 Unix Like 系统都会内建 vi 文书编辑器,其他的文书编辑器则不一定会存在 ...
- 小程序框架之视图层 View
(1)视图层View 框架的视图层由 WXML 与 WXSS 编写,由组件来进行展示. 将逻辑层的数据反应成视图,同时将视图层的事件发送给逻辑层. WXML(WeiXin Markup languag ...
- 运行Vue项目,没办法自动打开浏览器,提示“Unable to open browser. If you are running in a headless environment, please do not use the open flag.”
留坑,待解决 Unable to open browser. If you are running in a headless environment, please do not use the o ...
- 04 Spring的依赖注入
依赖注入:Dependency Injection.它是 spring 框架核心 ioc 的具体实现. 我们的程序在编写时,通过控制反转,把对象的创建交给了 spring,但是代码中不可能出现没有依赖 ...
- BZOJ3277 串 和 BZOJ3473 字符串
字符串 给定n个字符串,询问每个字符串有多少子串(不包括空串)是所有n个字符串中至少k个字符串的子串? 分析 参照自为风月马前卒和Candy?的题解. 广义后缀自动机不就是把很多串的SAM建到了一个S ...