I asked this before, but I have to ask again considering I still haven't found a way to do this. I need to know if there's a way to take a variable inputted into a C++ program and pass it to the terminal as an environment variable. Again, I'm running Ubuntu if it matters.
333kyle333
0
Newbie Poster
Recommended Answers
Jump to Postyou have a couple options
1) call setenv() function. The variable will disappear when the c++ program exits.
2) write a shell program to call your program and capture its return variable. Then return the value of the variable from main() so that the shell program can grab …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.