←back to thread

387 points pedro84 | 1 comments | | HN request time: 0.214s | source
Show context
Animats ◴[] No.14860964[source]
C's lack of array size info strikes again:

    memcpy(current_wmm_ie, ie->data, ie->len);
where "ie" points to data obtained from the net.
replies(2): >>14861129 #>>14861284 #
revelation ◴[] No.14861129[source]
C's lack of arrays strikes again. They are essentially syntactic sugar.
replies(1): >>14861235 #
frlnBorg ◴[] No.14861235[source]
What do you mean by C not having arrays?
replies(5): >>14861254 #>>14861256 #>>14861257 #>>14861262 #>>14861281 #
CobrastanJorji ◴[] No.14861257[source]
I assume they mean that C's support for "arrays" is essentially just C's support for pointer arithmetic plus a mapping of a[b] to *(a+b).
replies(2): >>14861354 #>>14862014 #
shitgoose ◴[] No.14862014[source]
shouldn't it be:

* (a + b * sizeof(T))

where T is array elements' type?

replies(1): >>14862368 #
1. astrange ◴[] No.14862368[source]
That's implied in + on a pointer. uint32_t* + 1 actually adds 4.