home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19221 < prev    next >
Encoding:
Text File  |  1993-01-05  |  893 b   |  34 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!ulowell!woods.ulowell.edu!tongb
  3. From: tongb@woods.ulowell.edu
  4. Subject: Piping and return code again! Please help !!!
  5. Message-ID: <1993Jan4.212844.1@woods.ulowell.edu>
  6. Lines: 23
  7. Sender: usenet@ulowell.ulowell.edu (News manager - ulowell)
  8. Organization: University of Lowell
  9. Date: Tue, 5 Jan 1993 02:28:44 GMT
  10.  
  11.  
  12. Please help!!!!!
  13.  
  14. How do we make piping works in C for a DOS system?
  15.  
  16. Dos offers:
  17.  
  18. c:> program1 | program2
  19.  
  20. to pass the output of the program1 as the input of the program2.  Now if we
  21. have a C var declared as
  22.  
  23. char mystring[] = "this is a string";
  24.  
  25. and we have a DOS program program2.exe which reads a string from stdin and
  26. return a exit code (used in batch file as errorlevel).
  27.  
  28. How do I pass mystring to the program2.exe and get a return code in C?
  29.  
  30. I can't sleep if this problem is not solved.  Please help !!!!
  31.  
  32. tongb@woods.ulowell.edu
  33.  
  34.