Can someone please help me with a short programme to read and then write a file.
Basically I wish to open a file say "numbers.text"
numbers.txt contains these four number in this order
I wish to read them into my app as a(0), a(1), a(2) and a(3)
So a(0)=2, a(1)=4, a(2)=3 and a(3)=1
Next I wish to open a file "order.txt" and write these numbers after sorting as
It is fairly basic but I'm new to C++ and generally trying to teach myself everything from scratch.
Thanks in advance.
Hey I'd consult
In the last 2 years my coworkers used C library functions to read and write files, so I sort of lost fluency in the C++ way, which is better IMO.
After reading that I get the idea but not quite enough.
I can work out how to order the numbers, that's the easy bit. It is just how to read and write number arrays to file.
Thanks I'll adapt that into what I have so far. :)