array search

i have an assignment that should read from a file something like:

brian mckelly //name of artis(string)
cplus plus site //titl (string one or more words)
water //mediu (water, black, yellow, red, white) enumerator
123x122 //size (struct) { height, width}
342 //room { front, back, upstair, downstair}
$34 //prise(float)



the user may specify a field and a value for that field and the program should return the work for that artis, for example user may specify artis and smithely and the program will return all the information regarding every job in the gallerie by that artist.


so far I create a menu and use switch/case statement, but I got stuck, dont know how to read the data from the file and search and display the results.

Last edited on
You need to read up on input from files.
Tutorial: http://www.cplusplus.com/doc/tutorial/files/
<fstream> reference: http://www.cplusplus.com/reference/iostream/ifstream/
;)
Last edited on
am I gonna have to use arrays to solve this problem? because I will be prompting the user to select a search criteria, such as name, title, mediu,size,etc..... then I will have to display everything with the choose criteria.
You don't have to use arrays if you don't want to. From what you're telling me I don't see why you would even need arrays at all...
Last edited on
Topic archived. No new replies allowed.