tags:

views:

123

answers:

2

I have a problem with stdout and stdin .when i store data by using stdout i cant getback the same data using stdin . so please help me how can i solve my problem. Ram

A: 

Can you give the code snapshot, and also tell what exactly you want to achieve.

Aman Jain
why was my reply downvoted?I really don't understand!!
Aman Jain
This should be a comment to the original question.
Steve Melnikoff
As Steve says, this would be better suited as a comment on the question, as it's not really answer. akway has posted a comment asking to see the existing code (at the exact same time as your answer), so this post isn't required anymore - you could delete it and regain a few reputation points!
dbr
+2  A: 

Data you write to stdout will not be automatically available to stdin. Data written to the stdout stream is available to be read by whatever process is connected to that stream. Normally that is the terminal or console where the program was started. It can also be another process that was connected to the first one through a pipe or it can be a file when redirection was used.

If you want to read the data your program wrote to stdout via stdin on a subsequent run you can use redirections like this

$ program > data.out

Will store anything that is written to stdout in the file data.out. Then,

$ program < data.out

... will make the contents of data.out available to the program in stdin

Please post your code and some more detailed description of what you are trying to do if this isn't what you were trying to achieve.

VoidPointer