Skip to content

StrEnd

Description

Pointer one past the last character of the string. Suitable as an iteration sentinel for [begin, end) loops.

Parameters

Name Direction Description
str in String to query.

Usage example (Cross-references)

Usage examples (Cross-references)
                return false;
            }
            i64 n = FileRead(&f, StrEnd(&out->raw), CHUNK);
            if (n < 0) {
                LOG_ERROR("ProcMapsLoad: FileRead failed");
    // Test StrEnd function
    bool test_str_end(void) {
        WriteFmt("Testing StrEnd\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        // Get a pointer to one past the last character using StrEnd
        char *end = StrEnd(&s);
    
        // Check that the pointer addresses the NUL terminator one past
Last updated on