Windows API Reference

Overview Details Examples See Also

QWORD

Type Definition: unsigned __int64

The QWORD type defines an unsigned 64-bit integer. This type is commonly used for representing large numerical values, memory addresses, and file offsets in Windows programming.

Description

In Windows programming, data types are fundamental to defining the size and interpretation of variables. QWORD is a standard Windows data type that explicitly specifies an unsigned integer occupying 64 bits of memory. This provides a large range for numerical values, from 0 up to 18,446,744,073,709,551,615 (264 - 1).

It is equivalent to the C++ type unsigned __int64. When working with low-level system functions, memory manipulation, or data structures that require a specific bit size, QWORD is often encountered.

Usage

You can declare variables of type QWORD like any other C/C++ data type:


#include <windows.h>

int main() {
    QWORD fileSize = 1024ULL * 1024ULL * 1024ULL * 4; // 4 GB
    QWORD processId = 123456789012345ULL;

    // Use fileSize and processId in your application logic...

    return 0;
}
            

The ULL suffix is important to ensure that the literal values are treated as unsigned 64-bit integers to avoid potential overflow or type conversion issues.

Key Characteristics

Important: Always use the ULL suffix when defining large literal values of type QWORD to ensure correct interpretation and prevent potential data loss due to type promotion rules.

Related Types

See Also