I have a promblem with following case : i have a properties.txt that included:
10 Napier St.
Palm Cove
350000
47 Darkien Cl.
Smithfield Heights
265000
i want to write: On start-up, the program is to prompt the user for the property listings filename (the sample file provided is called properties.txt). The file contains the street address, suburb and price (in whole dollars) of each property listed by the agent. Once opened, the program is to read the data for each property from the file into a single array of structs. thanks i am stuck with that promblem to do other case .. what should i do ?
Win Myat
0
Newbie Poster
Recommended Answers
Jump to PostFirst declare a structure that contains elments for street address, suburb, and price.
Then useing ifstream open and read the file.
I could write the code for you, but I won't. I wouldn't want to deprive you of the joy of doing that yourself :)
Jump to PostString Stream is probably better for this kind of function.
All 7 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
packetpirate
0
Junior Poster in Training
Win Myat
0
Newbie Poster
Dazaa
0
Light Poster
Win Myat
0
Newbie Poster
Win Myat
0
Newbie Poster
Dazaa
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.