Merging of two programs

Hey,
I am using borland c compiler. I want to merge two existing program in one program.
Can we merge two programs together ?? Can any tell me the solution for these ??
first program
#include<stdio.h>
int main(void) {
while(1) {
led_on();
for(int i = 0; i < 0xffff; i++);
led_off();
for(int i = 0; i < 0xffff; i++);
}
return 0;
}
Second program
#include<stdio.h>
int main(void)
{
printf("Welcome!!");
return 0;
}
Third program:

1
2
3
4
5
6
7
8
9
10
11
#include<stdio.h>
int main(void) {
printf("Welcome!!");
while(1) {
led_on();
for(int i = 0; i < 0xffff; i++);
led_off();
for(int i = 0; i < 0xffff; i++);
}
return 0;
}


PS : plese use code tags
http://www.cplusplus.com/articles/jEywvCM9/
And what if i have functions to be merged too.
Will the functions be add in a main file or in the header files??
Well you can add them in main file as well as header files (I am assuming user defined header files)
Topic archived. No new replies allowed.