im kinda stuck with a problem here.
Just had a code created (thanks to cplusplus +1)
Im trying to create a sort of membersystem.
So i have all the members with their date (username etc.)
in a .txt file.
How can I display all data from the .txt file as output?
I thought i might need a for-loop to display them all, till none is left.
Am i correct?
Could you please help me?
EDIT: Ok, Ive written some code to show all the data from the file.
It works now, but.
I want the data show in a colomn.
How can i do this?
If you want to sort the content of the file, you need to read it into memory (into some data structure) and sort it there.
How can I display all data from the .txt file as output?
You need to write it to stdout (with std::cout). You should realise that the way you read the file will get you strings that are delimited by space, tab and new line. It won't read the whole line.
I thought i might need a for-loop to display them all, till none is left.
You already have a loop to read the file. If all you wanted to do was write it out, you could use the same loop. But as you want to sort it first, you'll need another loop.