HI every one,

I know this is stupid question. But i am new bie in c++. Can you please tell me.

Question: I have two file a.cpp and b.cpp. i want to give output (some number) of a.cpp to as a input on other file b.cpp. And b.cpp will take this as a input and give ouput according to that. How to do that. Is there any function or api.


THanks in advance

Recommended Answers

All 5 Replies

Why u are not using jst 1 .cpp file using 2 functions named as a() and b().
jst pass the output of function a to function b.

Save the output from a.cpp in a file.
b.cpp reads the file.

Save the output from a.cpp in a file.
b.cpp reads the file.

thanks you for your reply.
Is there another way. i found some where that we can do that via ipc. but not sure.

you can use global variabled or shared memory

But i am new bie in c++.

Based on the above statement you made, the easiest is the file. All others are much more complex and not appropriate for the "new bie"

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.