3 ms·
Because as Linus stated: "array arguments in C don't actually exist" The bracket notation ex: myarray[2] is actually just a sugar syntax for: * (myarray+2) An
by esaym 11y ago
Because as Linus stated: "array arguments in C don't
actually exist"
The bracket notation ex: myarray[2] is actually just a sugar syntax for: * (myarray+2)
An array is nothing more than an address and a (hopefully) know length. Not really a "data structure" or object by no means.
You could definitely roll your own though with something like:
struct {
char * arr,
int size
} my_struct;
for(int i = 0; i < my_struct.size; i++){
printf('%x', my_struct.arr[i]);
}
ect,
- acconsta 11y agoYeah. But why is that the behavior specified by the standard?