Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
联合体可以在声明中初始化吗?
例如 假设我们有一个工会 typedef union unsigned long U32 float f U U32 F 当声明这个联合类型的变量时 有没有办法设置一个初始值 U U32 F u 0xffffffff Does not wo
c
initialization
declaration
unions
这个联合是否违反了严格的别名?浮点寄存器怎么样
union Uint32 Integer Float32 Real Field 我必须使用该联合来实现一些 IEEE 技巧 这会破坏严格的别名吗 GCC 不会发出任何警告 即使使用迂腐的严格别名 也尝试过 GCC 4 5 和 4 6 但据我
c
gcc
unions
floating
strictaliasing
C++ 匿名结构
我使用以下联合来简化字节 半字节和位操作 union Byte struct unsigned int bit 0 1 unsigned int bit 1 1 unsigned int bit 2 1 unsigned int bit 3
c
struct
unions
anonymousstruct
在 C++ 中获取集合的并集、交集或差集
我有几个关于如何使用 C 集 std set 的问题 有没有办法获得两个 C 集合的并集 交集或差集 编写自己的函数来做到这一点非常容易 但我想知道是否有内置函数 C 集合可以用作映射中的键吗 Use the set difference
c
Dictionary
set
Intersection
unions
当其他成员设置为新值时,C 联合成员给出特定/错误的值。为什么下面的 C 代码会输出这样的结果?
include
c
unions
结构错误中的联合
我有以下结构 struct type1 struct type2 node union element struct type3 e int val 初始化指针时 f指向一个实例type1并做类似的事情 f element gt e甚至只是
c
struct
unions
具有结构成员的 C++ 联合结构适用于 Clang 和 MSVC,但不适用于 GCC
我试图定义一个联合结构 其中一些结构和原始成员在内存中与一个简单的数组重叠 这在 Clang 和 MSVC 中完美运行 但不能用 GCC G 编译 struct Vector3 float x float y float z Vector3
c
gcc
struct
languagelawyer
unions
结构和联合之间的区别
有没有什么好的例子来说明 a 之间的区别struct and a union 基本上我知道struct使用其成员的所有内存并且union使用最大的成员内存空间 还有其他操作系统级别差异吗 对于联合 您只能使用其中一个元素 因为它们都存储在同
c
struct
unions
通过联合访问 __m128 变量的字节是否合法?
考虑这个变量声明 union struct float x y z padding components m128 sse data 我的想法是通过分配值x y z字段 执行 SSE2 计算并通过读取结果x y z 不过 我对这是否合法有些
c
SSE
unions
类型双关语与联盟成员访问
按照这个https stackoverflow com a 1812932 1814023 https stackoverflow com a 1812932 1814023 writing one member of union and
c
unions
typepunning
为什么我的工会没有显示正确的值?
union int i bool b x x i 20000 x b true cout lt lt x i 它打印出 19969 为什么它不打印出 20000 A union不是一个struct In a union 所有数据占用相同的空
c
unions
union '双关语'结构带有“公共初始序列”:为什么 C (99+) 而不是 C++ 规定了“联合类型的可见声明”?
背景 通过以下方式讨论类型双关的大多数非或实现定义的性质union通常引用以下位 此处通过 ecatmur https stackoverflow com a 31557852 2757035 https stackoverflow com
c
struct
unions
typepunning
...联合问题中不允许使用构造函数
我迫切需要找到以下问题的解决方案 namespace test template
c
visualc
gcc
struct
unions
错误:联合中不允许复制赋值运算符
当出现以下错误时 我正在编译下面的代码 我找不到原因 typedef union struct const int j tag X int main return 0 error member lt anonymous union gt l
c
struct
unions
C++ 联合体、结构体、成员类型
如果我有课 class Odp int i int b union long f struct WCHAR pwszFoo HRESULT hr 联合意味着 在列出的所有值中 它一次只能采用其中一个值 就访问这些变量而言 它是如何工作的 我
c
struct
unions
有没有办法通过联合访问各个位?
我正在写一个C程序 我想要一个可以作为字符访问的变量 但我也可以访问其特定位 我想我可以使用这样的工会 typedef union unsigned char status bit bits 8 DeviceStatus 但编译器不喜欢这样
c
Structure
bit
unions
无形状:从副产品映射到不同的副产品
在下面 我尝试创建一个多态函数来转换RawFeatureValue into a RefinedFeatureValue import shapeless object test type RawFeatureValue Int Doubl
scala
unions
shapeless
为什么匿名联合不能包含具有重要构造函数/析构函数的成员?
我可能是错的 但我发现的基本解释是联合无法初始化 因为它不知道要调用哪个成员的构造函数 编译器无法自动生成联合的构造函数 为什么不允许用户定义 union 构造函数 这将消除上述问题并允许具有重要构造函数 析构函数的工会成员的存在 另外 为
c
membership
unions
Swift 中的 C 联合类型?
如何在 Swift 中声明和使用 C 联合类型 I tried var value union var output CLongLong var input CInt 但它不起作用 更新 我想使用 union 来分割8 bytes numb
c
swift
unions
C++ 联合中“受保护”的意义是什么
受保护的成员或函数有什么用途吗 您不能从联合继承 因此没有子项可以访问它 它是否提供了功能用途 或者只是因为移除它很麻烦而存在 protected in a union变得完全等价于private 但是这个津贴没有坏处 并且避免了额外的特殊
c
unions
«
1
2
3
4
5
»