Question: Can anyone help with writing a C program for this problem? Write a program that takes two command line arguments. The first one is the

Can anyone help with writing a C program for this problem?

Can anyone help with writing a C program for this problem? Writea program that takes two command line arguments. The first one is

Write a program that takes two command line arguments. The first one is the name of a file. The second one is a word. Your program should search for the word in the file specified. Here is an example: Suppose I have input.txt in my current working directory. The content of this file is: Hi everyone. This is a test file that I created for assignment 2. This is the beginning of the second line in the file. I am getting tired of typing!! This should be the last line. Some sample input and output of this program: 1) Arguments: input.txt assignment Output of the program: Line: 1, character: 53 2) Arguments: input.txt second Output of the program: Line: 2, character: 30 3) Arguments: input.txt third Output of the program: Not found! So, the program is either returning the position of the first occurrence of the word (the word could appear in the file multiple times we just need the first position). Or print for the user that the word is not found

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!