Is it possible to write a program where its function is to incorporate itself permanently into that of another program's
ex. Prog 1 "hello world"
Prog 2 "some other function"
Prog 2 "some other function + hello world"
delete prog 1
result prog 2: that performs both tasks.
is this possible, and if so, can someone point me towards how I would go about accomplishing this task ?
Please at least point me towards its general direction. The point of this is to incorporate both programs into program two without program two's prior knowledge, while only using program one.
EDIT: I noticed this was posted in beginners, this was an accident I excuse myself.
EVEN MORE EDIT:
okay let me clarify myself
Lets say prog 2 is something super simple like
int main(){
cout << "hello world";
Sleep(500);}
how do i get prog one to inject code to it that will make it say
int main(){
cout << "hello world";
Sleep(500);
cout << "SECONDLINE";
Sleep(500);}