I'm trying to write my own version of getenv. I haven't started yet so I'm trying to understand environ first.
If it's a global why can't I print it in my function? Is environ a String or an array of chars? Why is environ a double pointer? Thank you.
#include <iostream>
#include <string>
#include <stdlib.h>
void myenv(char*);
void myenv(char* name)
{
std::cout<<environ;
}
int main(int argc, char** argv, char** environ)
{
myenv("PATH");
}