Linking C programs...

N

nringty

is there a way of linking two or more C programs... if there is a way
how is it done..... i want to know how linking is done.. please help.
 
N

Nelu

nringty said:
is there a way of linking two or more C programs... if there is a way
how is it done..... i want to know how linking is done.. please help.
The question is strange. Can you give more details?
I think the question is off-topic here, but you should be
a little more clear when asking questions.
 
N

nringty

what i want to do is join two programs together... i know it can be
done but im not sure how.
 
N

Nelu

nringty said:
what i want to do is join two programs together... i know it can be
done but im not sure how.

Do you have two C sources and want to compile them together?
 
N

nringty

this is what i want ..u open one source and from that source.... u can
open other sources.
 
N

Nelu

nringty said:
this is what i want ..u open one source and from that source.... u can
open other sources.
Please quote context when replying. Other people are seeing this
and you have to let them know what you are talking about.

Are you sure you're talking about different sources or already
compiled applications?

Tell me if this is right:

You have a file called p1.c and you compile it to p1.exe.
You have another file called p2.c and you compile it to
p2.exe.
Now you execute p1.exe and you want it to execute p2.exe?
If yes, the you can use the "system" function that you can find in
stdlib.h.
How you use the function depends on the implementation.

Different OSes give you the exec family of functions for more control.
There's also the option of creating dynamically linked libraries.
However, these are way off-topic here as they depend heavily on
your system.
 
N

Nelu

nringty said:
after compiling and viewing the program.
Quote context even when replying to your own posts.
I see you use GMail's interface. This is not a regular
Google group. This is NNTP.
Instead of clicking on the Reply link at the end of the post
click on the show options link and use the reply link provided
in there. It will automatically add the post you're replying to.
Also, don't top-post, i.e. don't type your reply above
the text you're replying to.
 
N

nringty

Nelu said:
Please quote context when replying. Other people are seeing this
and you have to let them know what you are talking about.

Are you sure you're talking about different sources or already
compiled applications?

Tell me if this is right:

You have a file called p1.c and you compile it to p1.exe.
You have another file called p2.c and you compile it to
p2.exe.
Now you execute p1.exe and you want it to execute p2.exe?
If yes, the you can use the "system" function that you can find in
stdlib.h.
How you use the function depends on the implementation.

Different OSes give you the exec family of functions for more control.
There's also the option of creating dynamically linked libraries.
However, these are way off-topic here as they depend heavily on
your system.



ya the way u mentioned obove is the way i want it.
 
N

Nelu

nringty said:
ya the way u mentioned obove is the way i want it.
You can snip my signature when posting a reply (follow-up)
as it's not important to our discussion. Thank you for
quoting context and not top-posting.

If that's what you want, then you can either use the family of
exec functions which depend on the system you are using or
you can use the system function in stdlib.h but its behavior is
implementation dependent. You should read the documentation
for your implementation to learn how you can use it successfully.
 
N

nringty

You can snip my signature when posting a reply (follow-up)
as it's not important to our discussion. Thank you for
quoting context and not top-posting.

If that's what you want, then you can either use the family of
exec functions which depend on the system you are using or
you can use the system function in stdlib.h but its behavior is
implementation dependent. You should read the documentation
for your implementation to learn how you can use it successfully.



thanks... i'll try it now.
 
N

Nelu

nringty said:
thanks... i'll try it now.
You're welcome.
Another observation: don't snip the name of the original poster.
You can snip the signature and anything that's irrelevant to the
discussion. Leave the name there (like: Nelu wrote: or nringty wrote:)
so people can follow the discussion and know who wrote what.
 
N

nringty

Nelu said:
You're welcome.
Another observation: don't snip the name of the original poster.
You can snip the signature and anything that's irrelevant to the
discussion. Leave the name there (like: Nelu wrote: or nringty wrote:)
so people can follow the discussion and know who wrote what.
ok i'll do that...
 
C

CBFalconer

nringty said:
.... snip ...

ok i'll do that...

Good man. You appear to learn quickly. I wish all the googlers
were like you. The following references may be of help.

http://www.caliburn.nl/topposting.html
http://www.netmeister.org/news/learn2quote.html
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.greenend.org.uk/rjk/2000/06/14/quoting.html
http://www.i-hate-computers.demon.co.uk/
http://web.ukonline.co.uk/g.mccaughan/g/remarks/uquote.html

--
"The power of the Executive to cast a man into prison without
formulating any charge known to the law, and particularly to
deny him the judgement of his peers, is in the highest degree
odious and is the foundation of all totalitarian government
whether Nazi or Communist." -- W. Churchill, Nov 21, 1943
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,174
Messages
2,570,940
Members
47,484
Latest member
JackRichard

Latest Threads

Top