Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing a command in C program & Redirecting output to String array

Status
Not open for further replies.

AnnaHere

IS-IT--Management
May 16, 2000
17
0
0
AU
Hi folks,<br>Anybody that can help ?<br>How do I execute a command in C and place contents<br>in a string for manipulation.<br><br>e.g wc &lt;file&gt; <br>(does a wordcount of file and outputs to stdout)<br><br>I don't want to redirect to a file, I would like to redirect to a string array.<br><br>Anna<br><br>
 
Then the restrinction would be the size of the array. If your output increases the size of the array. Anyway, just execute the command and read the input from stdout stream. Otherwise , you can redirect your output to any other stream and read that stream , this is the concept . <br><br>Does this answer your question ?<br>Thanx<br>Siddhatha Singh<br> <p>Siddhartha Singh<br><a href=mailto:siddhu_singh@hotmail.com>siddhu_singh@hotmail.com</a><br><a href=siddhu.freehosting.net> </a><br>
 
Executing a command in C program & Redirecting output to String array
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top