So, read the records from input, then sort them in RAM and then write them to file.dat. Why do you have to sort the records on the hard disk?
So, read the records from input, then sort them in RAM and then write them to file.dat. Why do you have to sort the records on the hard disk?
come on mam.. I am a newbie. I tried to use "std::get.ignore" but it says "error C2228: left of '.ignore' must have class/struct/union". Seriously mam, I am yet to get into this namespace business, and right now I don't understand these errors, so I am clinging on to what I learned in C programming. Please allow me some time to learn..
That was a typo on my part...
It should std::cin.ignore().
Anyway, if you just post errors on the way, we can help you. But if you keep quiet, then we don't know.
We are trying to steer you into writing safe and portable C++ code. Using C idoms in C++ will get ugly pretty quick.
If you would just post your errors and your current best attempt instead of trying to rush fixing the problem first... you will learn along the way.
Imagine you were picking grapes. Would you...
Pick a single grape, walk 200 metres (or 500ft, whatever) to carry it back to the winery, then walk back again pick a single grape, walk back to the winery etc etc?
Or would you pick a bunch of grapes, perhaps even a dozen bunches of grapes at a time, and then carry them back to the winery?
(The first one is sorting on disk, the second is sorting in memory)
My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"