subject

Write a c/c program that executes the command "ls" with standard output redirected to a file "a. txt". the same program then asks the user to enter a search key (using cin), reads the a. txt file to find it and reports whether the search key was found among the list of files in the current directory or not. note that you must use an exec() function to run the "ls" command and before that, you must redirect stdout to the file a. txt. also, at the end, you must report the result in the stdout. you cannot use the "system()" function. make sure to test your program.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
How can a user open a blank presentation? 1.on the file menu, click new, and then click recent templates 2.on the file menu, click new, and then click blank presentation 3. on the view menu, click templates, and then click recent templates 4. on the view menu, click samples, and then click blank presentation
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
Which type of file can be used to import data into a spreadsheet?
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
You are most likely to automatically encode information about
Answers: 1
You know the right answer?
Write a c/c program that executes the command "ls" with standard output redirected to a file "a. txt...
Questions
question
Mathematics, 29.03.2021 19:10
question
Mathematics, 29.03.2021 19:10
Questions on the website: 13722363