Hi,
I am a c++ noob and what I need is to ;
1)open console
2)open a file via dos console
3)when I open it, it will return an output and I need to read it.
I've been searching internet and all I can find is cin and cout commands =)
I managed to open the file I need but cannot read the output from console.
I can't post the code right now, Its on my laptop and doesn't have access to internet right now, but I'll try to explain it
1)I have a text file including some data
2)I have an .exe which I have to open via msdos console with text file
(I need to type C:\\myfile.exe data.txt in console)
3) executable file reads the text file and returns me an output(not as a text file unfortunately, it is on console) I need that input.
I managed to open files but i cannot read the input.
My console looks like this
C:\\myfile.exe data.txt
121.456 <== line i need to read
So let me get this straight cause im still confused. This is probably because I'm still quite new at C++.
1) - You have a text file with 121.456 in it.
2) - You have a executable program that you need to run in the command prompt to read the said text file.
3) - What the .exe read is displayed on the command prompt, you want to write some code to read that number from the command prompt?
Im quite confused here and if someone more experianced can chime in I think they might be of more help. The way I see it is if you want to read something from a text file by using a program you made in C++ why not eliminate the command prompt in general and just read straight from the text file?
Thank you!
That works, 1 last question now
I need to repeat this operation 200+ times and read each output.
Is it possible to keep only the last data in text file and delete previous ones?