IIT Bombay
CS 101 Lab 9 Exercises on Text/Strings
Thursday March 17th, 2011
Problem 1:
1. Your program accepts two command line arguments: they represent file
names.
2. Output the list of strings that are common to both these files.
sample files: spammer1
spammer2
Problem 2:
Extract some text from each of the files uploaded here .
Modify your program to find out words common between these extracted texts. The extracted texts
are to be stored in files.
Work on removing duplicates from the list of words found to be common.
If you convert your logic into a couple of functions, the solution will be more organized.
Submission: the cpp files
and a readme mentioning the
status of your program
Deadline: 11 pm.
Class programs for your reference:
strings
(string class and member functions compare, find, insert, replace,
size, capacity)
files
(ifstream
for reading, ofstream for writing)
Command
line arguments to main (argv[1],argv[2] will hold your two file
names)