cost 118 ms
stdint.h 庫中是否包含 integer 類型“擴展 integer 類型”?

[英]Are the integer types included in the stdint.h library "extended integer types"?

我正在學習 integer 轉換等級,但我有一個問題,我經常使用 stdint.h 庫,對於我讀到的關於“整數轉換等級”的內容,它說: “任何標准 integer 類型的等級應大於任何具有相同大小的擴展 integer 類型的等級。” 對於我所知道的“int”,例如,是一個標准的 integer ...

stdint.h 的類型轉換和 integer 提升是如何工作的?

[英]How does type conversion and integer promotion work for stdint.h?

在 C 中,我了解標准類型的類型轉換、integer 提升、轉換等,但是 stdint.h 類型如何影響這一點? 對於類型排名,規則 state: 任何兩個帶符號的 integer 類型都不應具有相同的等級,即使它們具有相同的表示形式。 任何無符號 integer 類型的等級應等於相應有符號 in ...

使用 INTXX_C 宏和執行類型轉換為文字有什么區別?

[英]What is the difference between using INTXX_C macros and performing type cast to literals?

例如,這段代碼被破壞了(我剛剛在實際代碼中修復了它......)。 它可以固定為, 但后來這通過了我的大腦。 我知道UINT64_C(1)是一個在 64 位系統中通常擴展為1ul的宏,但是它與僅僅進行類型轉換有什么不同呢? ...

這是 glibc printf 中的錯誤嗎?

[英]Is this a bug in glibc printf?

使用 glibc 中的stdint.h (gcc SUSE Linux 版本 9.2.1,Intel Core I7 處理器)我在直接打印INT32_MIN時遇到了一個最奇怪的行為: 輸出: 此外,如果我嘗試 我得到了相同的結果,但有編譯器warning: integer overflow in ...

如何在 Cs 默認 int 類型和<stdint.h>的 intXX_t 類型有效嗎?

[英]How does casting between Cs default int type and <stdint.h>'s intXX_t types work?

我正在處理一個代碼框架,它有很多預先存在的代碼,使用 C 中的常規舊int類型。但是,我需要編寫的代碼要求我使用固定長度的int32_t 。 但是,我需要能夠從常規代碼中獲取int方面的輸入,並輸出到也只是常規int變量。 從int32_t為int是否會保留變量的值或它的特定數據表示(在這種情況下, ...

2021-10-22 16:29:46   1   39    c / stdint  
搜索數組中的元素

[英]Searching elements in an array

我想使用 uint16_t 類型的變量在 uint8_t 類型的數組 days[] 中搜索元素的索引,該元素的下一個元素為 0x2 和 0x3,並打印元素“0x2”的索引值。 我已經分配了 'uint16_t search = 0x23' 但我不確定這是否可行 ...

C stdint 類型的預聲明

[英]Predeclaration of C stdint types

當我嘗試聲明在stdint.h中定義的某些類型時,會發生與/usr/include/bits/stdint-uintn.h:24:19預聲明的沖突typedef struct __uint8_t uint8_t; 錯誤信息:/usr/include/bits/stdint-uintn.h:24:1 ...

使用 Python.h 將 uint32_t 數組傳遞給 Python

[英]Passing uint32_t array to Python using Python.h

我正在嘗試為 C 中的 python 構造一個模塊。該模塊有幾行和方法,但最重要的方法之一是有效地傳遞 integer 表示將 uint32_t 數組連接到 python。例如,從代碼以下 我希望在 python 中 integer 表示十六進制元素的串聯,即 0x0000030000001100 ...

是否有必要包括<stdint.h>保證 C99 新類型的可移植性?</stdint.h>

[英]Is it necessary to include <stdint.h> to guarantee portability of C99 new types?

根據我的理解,C99 新類型如uint32_t 、 uint_fast64_t 、 uintmax_t等在&lt;stdint.h&gt;中定義。 但是,我注意到它們也在stdlib.h中定義,並且從gnu.org我發現它是檢查的許多標頭之一,但在其他網站中僅引用&lt;stdint.h&gt; ...

為什么 stdatomic.h 包含 atomic_uint_least16_t 和 atomic_uint_fast16_t 但不包含 atomic_uint16_t?

[英]Why does stdatomic.h contain atomic_uint_least16_t and atomic_uint_fast16_t but not atomic_uint16_t?

stdatomic.h似乎包含atomic_uint_least16_t和atomic_uint_fast16_t ,它們是stdint.h類型uint_least16_t和uint_fast16_t的_Atomic版本,但它不包含atomic_uint16_t 。 為什么? 有關N1548 草 ...

stdint.h include_next'd from stdint.h not found

[英]stdint.h include_next'd from stdint.h not found

我一直在為我計划的一些即將到來的項目組合一個 m68k 交叉編譯“環境/工具鏈”,我在 macOS(我的原生環境)上使用它時遇到了問題。 如果我按照自己的說明在 Linux 上安裝( https://github.com/tomstorey/m68k_bare_metal/blob/master/ ...

如何找到 uint_fast32_t 的寬度

[英]How do I find the width of a uint_fast32_t

我希望能夠移植fprintf()一個uint_fast32_t ,如stdint.h中定義的那樣,所有前導零。 例如,如果我的平台將uint_fast32_t定義為 64 位無符號 integer,我想使用%016lX之類的格式說明符fprintf() ,但如果它是 32 位無符號 Z157DB7D ...

如何檢查是否定義了固定寬度的整數

[英]How to check if fixed width integers are defined

在 C++ 中,固定寬度整數被定義為optional ,但我似乎無法找到推薦的方法來檢查它們是否被實際定義。 檢查固定寬度整數是否可用的便攜式方法是什么? ...

將 uint32_t 轉換為 int32_t 並在之后進行比較

[英]Casting uint32_t to int32_t and comparing them afterwards

我無法理解如何比較兩個整數,其中一個是 unsigned int32 而另一個是有符號 int32 工作。 讓我們考慮這個簡單的程序: 在這種情況下, a1超出了有符號的 32 位 integer 范圍,所以正如我在調試時確認的那樣,在它被轉換后, b1等於-1 。 但是它仍然打印“Equal”,而 ...

2019-11-12 23:13:29   3   1199    c / stdint  
為什么“stdint.h”的實現不同意UINT8_C的定義?

[英]Why do implementations of “stdint.h” disagree on the definition of UINT8_C?

UINT8_C宏在“stdint.h”中定義,具有以下規范 : 宏UINTN_C(value)應擴展為對應於uint_leastN_t類型的整數常量表達式。 然而,在野外,實現方式有所不同: 前兩個實現似乎大致相同,但第三個實現的行為不同:例如,以下程序使用AVR-libc和QP ...

在C中定義全局常量

[英]Defining global constants in C

如何在C中定義全局常量? 有人告訴我做這樣的事情 在header.h中 const u32 g_my_const; 在code.c中 #include "header.h" const u32 g_my_const= 10U; 但我得到一個編譯錯誤: 錯誤:未初 ...

uint32_t似乎在CMSIS Math文件中未知?

[英]uint32_t seems to be unknown in the CMSIS Math files?

我收到錯誤: CMSIS / DSP / Include / arm_math.h:3943:3:錯誤:未知類型名稱'uint32_t'; 你是說'wint_t'嗎? 我可以將stdint.h添加到arm_math.h中,但我認為我首先做錯了。 當然,如果需要,CMSIS開 ...

無法將uint64_t正確轉換為double。 我想念什么?

[英]Can't convert a uint64_t to a double properly. What am I missing?

為了提供一些背景信息,我正在用C對Java 8的JVM進行編碼,並且試圖打印位於常量池中的Double值。 我有兩個變量uint32_t代表雙精度值的高低值。 我正在嘗試將其打印出來,但是我無法弄清楚我的代碼出了什么問題。 我嘗試打印所有值進行檢查。 uint64_t high_ ...

uint8_t在達到255不能正常工作后沒有翻轉到0

[英]uint8_t not rollover to 0 after reaching 255 not working properly

我是C-Headers的新手 - stdint.h和inttypes.h 。 我正在嘗試一些代碼來了解uint8_t工作原理。 但是,它似乎遇到了一個問題。 我已經分別聲明了4個uint8_t整數,邊界值分別為0,255,256,-1,並對它進行了一些簡單的算術運算。 我這樣做是因為 ...


 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM