StrCharPtrAt

Table of Contents

StrCharPtrAt

Description

Get pointer to character at given index

Usage example (Cross-references)

    // Test StrCharPtrAt function
    bool test_str_char_ptr_at(void) {
    printf("Testing StrCharPtrAt\n");
    
    Str s = StrInitFromZstr("Hello");
    // Access character pointers at different indices
    // Now using the fixed StrCharPtrAt macro
    char* p0 = StrCharPtrAt(&s, 0);
    char* p1 = StrCharPtrAt(&s, 1);
    char* p2 = StrCharPtrAt(&s, 2);
    // Now using the fixed StrCharPtrAt macro
    char* p0 = StrCharPtrAt(&s, 0);
    char* p1 = StrCharPtrAt(&s, 1);
    char* p2 = StrCharPtrAt(&s, 2);
    char* p3 = StrCharPtrAt(&s, 3);
    char* p0 = StrCharPtrAt(&s, 0);
    char* p1 = StrCharPtrAt(&s, 1);
    char* p2 = StrCharPtrAt(&s, 2);
    char* p3 = StrCharPtrAt(&s, 3);
    char* p4 = StrCharPtrAt(&s, 4);
    char* p1 = StrCharPtrAt(&s, 1);
    char* p2 = StrCharPtrAt(&s, 2);
    char* p3 = StrCharPtrAt(&s, 3);
    char* p4 = StrCharPtrAt(&s, 4);
    char* p2 = StrCharPtrAt(&s, 2);
    char* p3 = StrCharPtrAt(&s, 3);
    char* p4 = StrCharPtrAt(&s, 4);
    
    // Check that the pointers are correct

Share :