I was wondering if it would be possible to create a C++ environment variable using C++ CGI variable. I was thinking something along the li开发者_如何学Pythonnes of a temp environment variable so that I could share data between two CGI programs.
Conceptually, environment variables being set from (inside) a process, which a CGI program is, only exist for the lifetime or in the scope of that process. They are only "visible" (or accessible) for that process or (possibly) its children.
Also, environment variables are not 'C++' specific, but an operating system (or shell, depending on where you come from) feature.
Even if it would be possible, it is arguably not a good idea to exchange data in that way. You could not (reliably/easily) address issues like concurrent modification, etc. with environment variables.
You should look into other concepts of IPC (interprocess communication).
精彩评论