-
Notifications
You must be signed in to change notification settings - Fork 296
Arrow operator on arrays #662
Copy link
Copy link
Closed
Description
If the arrow operator is used on an array, then the debugger currently shows a blank cell, while in C it would access the first element.
I often use a single-element array for stack variables that are repeatedly passed by pointer. Example:
void inner(string_builder *sb, ...);
void outer()
{
string_builder sb[1] = {0};
inner(sb, ...);
inner(sb, ...);
inner(sb, ...);
inner(sb, ...);
inner(sb, ...);
}
Within inner, both sb->some_field and sb[0].some_field work, but within outer, only sb[0].some_field produces a result. It would be convenient if some_field could be accessed in both inner and outer using the arrow operator, like in C.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels