R
Rookie
I was just reading about the envp argument for main function. Since
there is no argc equivalent for envp (i.e the number of elements for
the envp array are not known) the last element will be a null pointer.
But my question is about the syntax used to test this:
envp!=(char *)0
[This generally appears in a for, something like
for(i=0;envp!=(char *)0;i++)]
What exactly does (char *)0 stand for? Is it a test for null pointer?
Can we use nul for the same as in:
for(i=0; envp!=nul;i++)
Hope to hear from someone. Thanks.
there is no argc equivalent for envp (i.e the number of elements for
the envp array are not known) the last element will be a null pointer.
But my question is about the syntax used to test this:
envp!=(char *)0
[This generally appears in a for, something like
for(i=0;envp!=(char *)0;i++)]
What exactly does (char *)0 stand for? Is it a test for null pointer?
Can we use nul for the same as in:
for(i=0; envp!=nul;i++)
Hope to hear from someone. Thanks.