in C there are certain variables from other programs which we would need to access... how can it be accessed and what is the type of variable and the coding used....

Recommended Answers

All 6 Replies

Concurrent access to data shared between programs is specific to your implementation (OS, compiler, etc).

Unless your shared data exists in a file which one program writes to, then another program reads. That's pretty portable.

what i wanted to know was that is this kind of access possible in programs which do not involve file handling i.e. data is not stored in files.....

>what i wanted to know was that is this kind of access
>possible in programs which do not involve file handling
Read Salem's post again. It's possible, but implementation dependent. You haven't told us your OS or compiler, yet you still expect a complete answer. :icon_rolleyes:

I'm using borland compiler on windows.... is this info enough?? pls help me....

If you wrote both programs then you could use (1) Clipboard, (2) Pipes, (3) sockets (4) COM objects. The simplest to implement is the clipboard. If you would tell us more detailed information such as (1) did you write both programs (2) if not then how does the program save the data that you want.

hi,
see for any client- server programmming in C,
In these you would have a client program ( say Client.c) and anothe sever program (Server.c)
you would run both of them in different windows.
Let us suppose the server program is designed to accept two integers and return their sum.
So on the client side you enter two integers.
The two numbers are in a named pipe.
the server program too reads / waits for values in the same pipe ( you need to specify the same pipeid in both server and client programs ).
once it gets the values - it computes the sum and puts them in another pipe ( PIPE_2)
the client program now has to read for values from the PIPE_2.
and displays the same.

The text I would suggest is the Network Programming by Richard Stevens ( vol -II)

Ram Sharma

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.