I made a program, and I would like to add this other program I made to it also. But I dont want to type in the program and make it a function. Is there a faster way to to link them?
I want this [Namemean.c] in [MazeV1.3.c].
Printable View
I made a program, and I would like to add this other program I made to it also. But I dont want to type in the program and make it a function. Is there a faster way to to link them?
I want this [Namemean.c] in [MazeV1.3.c].
What's the goal of this? Are you making a menu in which one can choose which program to run? In that case you could rename the main of the program in Namemean.c to something like main_of_namemean and call this in the other program. Perhaps you'll need to restructure the function a little bit, but since main is just a function, it should work.
You *could* just #include "Namemean.c" in the beginning of MazeV1.3.c, which is the same as pasting that code to that position.Quote:
Originally posted by Goof Program
I made a program, and I would like to add this other program I made to it also. But I dont want to type in the program and make it a function. Is there a faster way to to link them?
I want this [Namemean.c] in [MazeV1.3.c].
However this in not the right way to do this. You have to use the linker. I've had problems with linking, so I'm not the right person to ask :)
>You *could* just #include "Namemean.c" in the beginning of
>MazeV1.3.c,
If both Namemean.c and the other file have a main-function, then you'll get errors. A program can't have to main functions.