stdint Questions
10
Solved
The stdint.h header lacks an int_fastest_t and uint_fastest_t to correspond with the {,u}int_fastX_t types. For instances where the width of the integer type does not matter, how does one pick the ...
Cashbook asked 12/9, 2010 at 7:54
4
Solved
I'm trying to subtract two unsigned ints and compare the result to a signed int (or a literal). When using unsigned int types the behavior is as expected. When using uint16_t (from stdint.h) types ...
7
Solved
C99 standard has integer types with bytes size like int64_t. I am using Windows's %I64d format currently (or unsigned %I64u), like:
#include <stdio.h>
#include <stdint.h>
int64_t my_int...
1
When compiling in VC6 I am receiving the error:
(fatal error C1083: Cannot open include file: 'stdint.h': No such file
or directory)
Can anyone explain why I am receiving this error?
Scroggins asked 6/12, 2013 at 15:26
2
Solved
I'm writing a CUDA kernel that is compiled at runtime using NVRTC (CUDA version 9.2 with NVRTC version 7.5), which needs the stdint.h header, in order to have the int32_t etc. types.
If I write th...
Skean asked 28/5, 2018 at 11:19
2
Solved
In C++, fixed width integers are defined as optional, but I can't seem to find the recommended way to check if they are actually defined.
What would be a portable way to check if fixed width intege...
3
Solved
I'm having trouble understanding how does comparing two ints, where one is unsigned int32 and the other one signed int32 work.
Let's consider this simple program:
#include <stdint.h>
int m...
3
Solved
The UINT8_C macro is defined in "stdint.h", with the following specification: The macro UINTN_C(value) shall expand to an integer constant expression corresponding to the type uint_leastN_t.
In th...
Zapateado asked 8/8, 2019 at 16:37
3
I am new to the C-Headers - stdint.h and inttypes.h. I was trying out some code to get an inkling of how uint8_t works. But, it seems to have encountered a problem.
I have declared 4 uint8_t integ...
3
I am trying to reinterpret a uint8_t as an int8_t (and back again) in a way that is portable. I'm as I am receiving over a serial channel that I store in a buffer of uint8_t, but once I know what k...
3
Solved
Preamble: I want to convert a pointer to an integer type, e.g. to check alignment. uintptr_t seems to be the correct type, but it is guaranteed only in C, not in C++ (or C++11)
For the following c...
1
Solved
I was reading C in a Nutshell and found this:
"If an optional signed type (without the prefix u) is defined, then
the corresponding unsigned type (with the initial u) is required, and vice vers...
3
Solved
One thing that bugs me about the regular c integer declarations is that their names are strange, "long long" being the worst. I am only building for 32 and 64 bit machines so I do not necessarily n...
4
Solved
I'm under the same impression as this answer, that size_t is always guaranteed by the standard to be large enough to hold the largest possible type of a given system.
However, this code fails to c...
4
Solved
If you want to use Qt, you have to embrace quint8, quint16 and so forth.
If you want to use GLib, you have to welcome guint8, guint16 and so forth.
On Linux there are u32, s16 and so forth.
uC/O...
3
The x32 ABI specifies, among other things, 32-bit pointers for code generated for the x86_64 architecture. It combines the advantages of the x86_64 architecture (including 64-bit CPU registers) wit...
Kehr asked 30/4, 2016 at 22:51
3
Solved
I'm working on an existing C++ codebase that happens to use SIZE_MAX in a couple of places. I did some refactoring and now SIZE_MAX is not defined in one of the modules. This problem appeared when ...
5
Solved
I found that in C99 you should #include <stdint.h> and that seems to work with my C++03 gcc compiler too, but is that the right header for modern C++, is it portable?
Destalinization asked 1/9, 2012 at 13:57
2
Solved
I saw different types of definition of an integer in stdint.h. I'll take unsigned 32-bit integer as an example.
uint32_t means clearly an unsigned integer of 32 bits. That's the one I always use...
1
Solved
can someone explain the difference between the types uint8_t and __u8 ?
i know that uint8_t are defined in stdint.h and they are available on every unix system.
/* Unsigned. */
typedef unsigned c...
3
Solved
What is the difference between stdint.h and cstdint?
Both of them are available in MSVC (Visual Studio 2010) and gcc-4.5.1. Also both define the intX_t/uintX_t types (where X is the size of the typ...
1
Solved
Possible Duplicate:
Visual Studio support for new C / C++ standards?
See the text below from wiki:
The C99 standard includes definitions of several new integer types to enhance the p...
1
Solved
I'm be suprised with that include stdint.h works but include cstdint not.
$ aCC sizeof.cpp
"sizeof.cpp", line 5: error #2005-D: could not open source file "cstdint"
#include <cstdint>
^
1...
4
Solved
I already know that stdint is used to when you need specific variable sizes for portability between platforms. I don't really have such an issue for now, but what are the cons and pros of using it ...
4
Solved
I need to declare an integer in the size of 16 bit, in C.
I know that short and int sizes are machine dependent.
I tried to use "stdint.h", but it seems that they simply do
typedef short int16_...
1 Next >
© 2022 - 2025 — McMap. All rights reserved.