previous4 - S. Karaki American University of Beirut...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: S. Karaki American University of Beirut December 23, 2004 Department of Electrical and Computer Engineering EECE 230 - Section 5: Quiz # 2 (Duration 2 Hours) Purpose: Test your ability in writing programs to solve simple problems using arrays, pointers, strings, files, and classes with operator overloading 1. Write a program that reads a series of strings from a file into a buffer. Each time a string is read its length should be determined, and it should be stored in the heap at a location obtained using the dynamic memory allocation operator “ new ”. The locations in the heap of the various strings should be kept in an array of pointers to characters. Test your program by printing the character strings in the order in which they were read. Extend the program to search (i.e., use a linear search) if a given character string is found at the beginning of any of the various strings that were read and stored. When found print the string that contains the string being searched for. When not read and stored....
View Full Document

Ask a homework question - tutors are online