Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is u_int64_t available on 32-bit machine?

Tags:

c

linux

I want to use a u_int64_t variable as search key,

is u_int64_t available on 32-bit machine?

if not, I have to divide this variable into two varibles? then as a search key, it is a bit more troublesome

are there any workaround for this?

like image 366
user1944267 Avatar asked May 13 '13 11:05

user1944267


People also ask

Is there uint64_t?

uint64_t doesn't call anything, it is just a 64bit unsigned integer. This code is a function named clearBits() that is manipulating bits in an integer and returning the result.

Is uint64_t unsigned long?

In 32-bit mode, the compiler (more precisely the <stdint. h> header) defines uint64_t as unsigned long long , because unsigned long isn't wide enough. In 64-bit mode, it defines uint64_t as unsigned long .


2 Answers

An unsigned 64-bit integral type is not guaranteed by the C standard, but is typically available on 32-bit machines, and on virtually all machines running Linux. When present, the type will be named uint64_t (note one less underscore) and declared in the <stdint.h> header file.

like image 169
user4815162342 Avatar answered Sep 19 '22 15:09

user4815162342


Yes 64 bit integer datatype is supported on a 32 bit machine.

In C89 Standard , long long (≥ 64, ≥ size of long) type is supported as a GNU extension. In C99 standard, there is native support for long long(≥ 64, ≥ size of long) integer.

like image 20
Barath Ravikumar Avatar answered Sep 17 '22 15:09

Barath Ravikumar