how can one called function in c++ program where function is declared in other c++ program?
how can one do this? can i use extern?
how can one called function in c++ program where function is declared in other
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
I would suggest the best way is to refactor the first C++ program such that the required function is made part of a library. Then both your programs can link to that library and the function is available to both (and to any other programs requiring it).
Take a look at this tutorial. It covers how to create and then use a library using
gcc. Other similar tutorials will exist for other C++ variants.