Good day everyone, well I started to learn c++ not long ago.
Need to do one thing but I am not able to. Even people I learn with couldnt do it.
So here is the thing. I had to make a txt file where there is a list about houses. Four types info in columns. Where they are, type, size and price.
So I need it to show info than let user to choose which column he wants. Price,size or location. Sort it in order and then put it in txt file. Every column needs to be put in another txt file.
I needs to be done using map. Making container puting info there there than taking out what you need.
So here is the thing. I had to make a txt file where there is a list about houses. Four types info in columns. Where they are, type, size and price.
Show example of file. How columns are separated? Are there whitespaces in location?
So I need it to show info than let user to choose which column he wants. Price,size or location. Sort it in order and then put it in txt file. Every column needs to be put in another txt file.
So you need 4 txt files? One with location, one with price, one with size and one with type?
Three txt files. My list starts with location,type,size and price. I need to do this with map unfortunatly :/
I only need size,price and location. House type is not needed.
Here is the code which reads content of the file into vector and then sorts it by chosen method. http://pastebin.com/uFEfsPqn
How is it looks: http://puu.sh/9gczr/2be103dcaa.png
What is missing: output to files (simple enough to not include it here) and map. I could use set here, but map? I could store comparator functions in map<int, function<....>> but It is unnesesary.