Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's... not true?

Example in C:

void fun(void) {

    int a[16];

    for (int i = 0; i < sizeof(a); i++)
    {
        a[i] = 1;
    }
}

I have allocated and referred to memory without pointers here.



in some form or another is the key to their point.

Here's something to try at home .. exactly your code save for this change:

    i[a] = 1;
... guess what, still compiles, still works !!

WTF ??? you ask, well, you see, X[Y] is just syntactic sugar for X+Y - it's a pointer operation disguised to look like a rose (but it smells just the same).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: