In the proccess of learning C, I'm trying to write a program that accepts one of your environment variable as input, and outputs its value.
The question is, is there any way to know the length of envp? I mean, how many envp is there? I'm aware that it is a char** - an array of string. And finding the size of array in C is problematic already. What can I do to know the size of envp?
Please just provide direction, not the concrete answer (or code).
It's terminated by a NULL pointer. You have to count it if you want to know the length.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With