Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
实现 `memcpy()`:需要 `unsigned char *`,还是只需要 `char *`?
我正在实施一个版本memcpy 能够与它一起使用volatile 使用安全吗char 或者我需要unsigned char volatile void memcpy v volatile void dest const volatile v
c
pointers
casting
char
unsigned
从“(signed) -1”到“unsigned long”的转换是否标准化? [复制]
这个问题在这里已经有答案了 In 这个答案 https stackoverflow com a 51234964 65863 你可以找到这条评论 https stackoverflow com questions 40608111 why
c
typeconversion
specifications
unsigned
signed
将有符号整数转换为无符号长整型的最佳方法?
对于 Java 中的某些哈希函数 最好将值视为无符号整数 例如 用于与其他实现进行比较 但 Java 仅支持有符号类型 我们可以将有符号的int到 未签名 long像这样 public static final int BITS PER B
Java
unsigned
Go 中有 uint64 文字吗?
我正在看数字类型 https golang org ref spec Numeric types在围棋中 我想使用 uint64 文字 这在 Go 中可能吗 这是我想如何使用 uint64 文字的示例 for i 2 i lt k i 1
go
longinteger
literals
unsigned
uint64
初始化无符号字符的正确方法*
正确的初始化方法是什么unsigned char 我目前正在这样做 unsigned char tempBuffer tempBuffer 或者我应该使用memset tempBuffer 0 sizeof tempBuffer 要 正确
c
char
unsigned
Java 7 未签名小程序权限 1.7.0_45
我们有一个需要某些权限的小程序 我们对其进行签名并授予所有权限 然而 在开发时我们使用未签名的小程序 我们在用户主目录中的 java policy 文件中设置所有权限 这在 1 7 0 45 或可能 40 中已停止工作 因为未签名的小程序不
Java
permissions
applet
unsigned
为什么“for (i = 100; i <= 0; --i)”会永远循环?
unsigned int i for i 100 i lt 0 i printf d n i 应该i gt 0如果你希望它从 100 循环到 0 则在循环的第二个条件中 正如其他人指出的那样 您需要更改对的定义i到一个有符号整数 只是int
c
loops
Comparison
unsigned
使用十六进制数初始化无符号字节数组
我知道无符号字节缺失于Java那么如何使用整数初始化字节数组0 到 255 十六进制 final byte assoc resp msg int new byte 0xe3 0x00 APDU CHOICE Type AareApdu 0x
Java
Byte
unsigned
为什么 C 和 C++ for 循环使用 int 而不是 unsigned int?
这是一个相当愚蠢的问题 但为什么int常用来代替unsigned int在 C 或 C 中为数组定义 for 循环时 for int i i
c
forloop
int
unsigned
如何更改 unsigned char 中的 4 位?
unsigned char adata unsigned char malloc 500 sizeof unsigned char unsigned char single char adata 100 如何更改 single char 中
c
TCP
unsigned
bit
bitshift
Java 中的无符号短整型
我怎样才能声明unsigned shortJava 中的值 你不能 真的 Java 没有任何无符号数据类型 除了char 诚然你could use char 这是一个 16 位无符号类型 但在我看来这将是可怕的 因为char显然适用于文本
Java
types
unsigned
short
为什么从返回 int32_t 的函数返回 0x80000000 不会导致警告?
考虑 int32 t f return 0x80000000 为什么这不会导致编译器警告 至少在 GCC 上 0x80000000 超出范围int32 t INT32 MAX is 0x7fffffff 我相信这应该会导致隐式转换 这是正确
c
types
casting
typeconversion
unsigned
为什么 1ul << 64 返回 1 而不是 0? [复制]
这个问题在这里已经有答案了 考虑下面的代码 Simply loop over until 64 is hit unsigned long x 0 for int i 0 i lt 64 i if i 64 x 1ul lt lt i pri
c
Math
gcc
longinteger
unsigned
C#:无法从 ulong 转换为 byte
奇怪的是我可以在 C 中做到这一点 但在 C 中却不行 为了清楚起见 我将在 C 中粘贴这两个函数 然后在 C 中粘贴 并使用注释 error 标记 C 代码中有问题的行 这两个函数的作用是对参数进行编码 然后将其添加到名为 byte1se
c
Byte
longinteger
unsigned
无符号函数必须返回一些东西吗?
嘿 我正在做一个练习 我必须用 C 编写一个无符号函数 我有一个问题 我是否必须因为函数的类型而返回一些东西 还是可以选择的 在正常使用中 任何声明返回值的函数都应该返回一个值 这很大程度上是一个良好的编程实践的问题 未能返回值通常是错误的
c
function
unsigned
使用 ruby 将存储为有符号的无符号整数转换回原始值
C 程序将它认为是 64 位无符号整数放入 Postgres 数据库中类型为 int8 的列中 对于 Postgres int8 始终是 signed int8 没有 unsigned int8 这样的东西 因此 我的 Ruby 程序将从
ruby
postgresql
unsigned
signed
无符号负基元?
在 C 中我们可以创建原语unsigned 但他们总是积极的 还有一种方法可以生成无符号负变量吗 我知道 无符号 这个词的意思是 没有符号 所以也不是减号 但我认为C 必须提供它 No unsigned只能包含非负数 如果您需要一个仅表示负
c
unsigned
primitive
negativenumber
作为索引的无符号数字与有符号数字
在 Net 中使用带符号数字作为索引的理由是什么 在 Python 中 您可以通过发送负数从数组末尾开始索引 但在 Net 中并非如此 Net 稍后添加这样的功能并不容易 因为它可能会在索引上使用特殊规则 是的 一个坏主意 但我猜它会发生
NET
unsigned
signed
Indexing
当我将负值赋给 unsigned int 时会发生什么? [复制]
这个问题在这里已经有答案了 可能的重复 C 中的有符号到无符号转换 它总是安全的吗 https stackoverflow com questions 50605 signed to unsigned conversion in c is
c
unsigned
如何处理“有符号/无符号不匹配”警告 (C4018)?
我使用大量编写的计算代码c questions tagged c 2b 2b考虑到高性能和低内存开销 它使用STL容器 主要是std vector 很多 并且几乎在每个函数中迭代该容器 迭代代码如下所示 for int i 0 i lt t
c
Comparison
refactoring
unsigned
signed
1
2
3
4
»