News for hackers. Stuff that matters.
Re:Interesting C Interview Questions and Answers by ambrice on Tuesday August 28, 2012 @08:16PM (#4446497)
It also wouldn't work. This just reassigns your local copy of argv[0] to a different memory location. Also, in what circumstances can argc be 0?
Re:Interesting C Interview Questions and Answers by tedunangst on Tuesday August 28, 2012 @10:27PM (#4446804)

    int main()
    {
        char *args[] = { 0 };
        execve("./zero", args, 0L);
    }
zero will have argc == 0.
Re:Interesting C Interview Questions and Answers by mturmon on Tuesday August 28, 2012 @11:44PM (#4447000)
On my MBP with gcc 4.2.1, it does work -- I tried it before posting. (Your interpretation of what it does is correct.)