Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7865325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:03:17+00:00 2026-06-03T00:03:17+00:00

I want to write two c++ application the first one called caller, the second

  • 0

I want to write two c++ application the first one called “caller,” the second called “processor.”

caller application send a value to a processor. after that processor do some process on that value and return it back to caller.

I want to know the best way to do that.

so far I know how to send value from caller application to processor application but I could not find any way to return the value back. one of this way by using putenv() and getenv()

caller example

#include <iostream>
#include <stdlib.h>

using namespace std;

int main(int argc, char **argv, char** envp){
    char myvar[]="MYVAR= say something";
    putenv(myvar);
    cout<<getenv("MYVAR")<<endl;
    system("./processor");
    cout<<getenv("MYVAR")<<endl;
}

processor example

#include <iostream>
#include <stdlib.h>

using namespace std;

int main(int argc, char **argv, char** envp){
    char myvar[]="MYVAR= say something else";
    putenv(myvar);
    cout<<getenv("MYVAR")<<endl;
}

how to fix that to return value from processor to caller and if there is better way what is it. I am using Ubunut OS.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:03:18+00:00Added an answer on June 3, 2026 at 12:03 am

    There are many possible ways to communicate between to processes, and which is best depends on a lot of factors. Using the environment is basically only good for one-way communication, not bidirectional communication. The methods available include:

    • Environment variables (one way)
    • Command-line arguments (one way)
    • Pipes
    • Files
    • Sockets
    • FIFOs
    • Shared memory
    • Message queues
    • Signals
    • Semaphores

    Some are limited to processes connected by a common ancestor; others can work between unrelated processes, sometimes not even on the same machine. Some mechanisms can communicate very little data (signals, for example); others can communicate large quantities of data. Some require no synchronization; others require extensive synchronization.

    Which is best for you? We don’t have enough information to guess. However, your best choice is most likely between pipes, files and sockets.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to write a translator between two languages, and after some reading on
I want to write a long running process (linux daemon) that serves two purposes:
I want to write a cmp -like function that compares two version numbers and
Let's say there are two python scripts that want to write data to the
I want to write my first real MultiThreaded C# Application. While I used a
This is actually two questions in one: First, when you write your XAML and
I am attempting to write a two-pass algorithm incorporating some legacy code. I want
I've noticed that if you want to write an application that utilizes listening sockets,
I want to write class whose constructor takes two parameters, but the arguments are
Hello I want write my own desktop sharing application in Java. The application should

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.