I have two programs given below in two separate files in c++.
File A.cpp
void name(){
cin>>name;
}
File B.cpp
void age(){
cin>>age;
}
Now, I need to use the function name
in file B. Can I do it without rewriting the entire function (name
) in file B.cpp
? Can I import functions in C++, just like you do in other languages, such as JavaScript?