Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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?

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions

Question

Has the priority order been provided by someone else?

Answered: 1 week ago

Question

Compare the current team to the ideal team.

Answered: 1 week ago

Question

Are the rules readily available?

Answered: 1 week ago