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?
[ Parent
| on HN ]
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.