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)
- In
ProcMaps.c:215:
if (!StrReserve(raw, grown_to))
return false;
i64 n = FileRead(f, StrEnd(raw), CHUNK);
if (n < 0)
return false;- In
ProcMaps.c:288:
return false;
}
MemCopy(StrEnd(&out->raw), bytes, len);
StrResize(&out->raw, len);
}- In
Access.c:103:
// Test StrEnd function
bool test_str_end(void) {
WriteFmt("Testing StrEnd\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Access.c:110:
// 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