0

I was wondering if it would be possible to create a C++ environment variable using C++ CGI variable. I was thinking something along the lines of a temp environment variable so that I could share data between two CGI programs.

0

1 Answer 1

2

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).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.