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
You are almost finished updating a web site. as part of the update, you have converted all pages from html 4.0 to html5. the project is currently on schedule. however, your project manager has been asked by the marketing team manager to justify a day of time spent validating the site's html5 pages. the marketing team manager does not have technical knowledge of the internet or the web. which is the most appropriate explanation to provide to the marketing team manager?
Answers: 1
question
Computers and Technology, 22.06.2019 13:30
Write lines of verse that rhyme to remember the following information: acid rain is a type of air pollution caused by chemicals in the air.
Answers: 1
question
Computers and Technology, 22.06.2019 14:30
The “rule of 72” is used to approximate the time required for prices to double due to inflation. if the inflation rate is r%, then the rule of 72 estimates that prices will double in 72/r years. for instance, at an inflation rate of 6%, prices double in about 72/6 or 12 years. write a program to test the accuracy of this rule. for each interest rate from 1% to 20%, the program should display the rounded value of 72/r and the actual number of years required for prices to double at an r% inflation rate. (assume prices increase at the end of each year.)
Answers: 1
question
Computers and Technology, 22.06.2019 16:10
Drag each label to the correct location on the imagelist the do’s and don’ts of safeguarding your password.keep yourself loggedin when you leave your computer.don’t write your password down and leave it whereothers can find it.share your password with your friends.each time you visit a website,retain the cookies on your computer.use a long password with mixed characters.
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
Computers and Technology, 28.07.2021 14:00
question
Mathematics, 28.07.2021 14:00
question
Mathematics, 28.07.2021 14:00
question
Mathematics, 28.07.2021 14:00
question
Mathematics, 28.07.2021 14:00
question
Mathematics, 28.07.2021 14:00
question
Physics, 28.07.2021 14:00
question
English, 28.07.2021 14:00
question
Mathematics, 28.07.2021 14:00
question
History, 28.07.2021 14:00
Questions on the website: 13722361