hello everybody , i'm now learning c++ and i have this probleme that i'm hopping that you help me with it , you see i want to display a file.txt on the desktop yousing c++ i managed to write my data in the file but what i need is to open the file automatically after the writing is finished , i don't want to open the file on the terminal but i want the file to open on the desktop
Can anyone help me with this pleaaaaaaaaaaaaaaaaaaaaase
This link show how to create a file.txt on desktop , what i need is to open it automatically after the writing is finished on the desktop , you see where i'm going here ??
Yes.
You don't want to use existing terminal programs that show the output stream of your program in a GUI window. By "desktop" you don't mean special directory.
By "desktop" you mean GUI. You want to create a GUI window (with all the bells and whistles) within your application that renders the "output content" as text within it.
Am I right?
Qt http://www.qt.io/ is one framework that helps you to do that "relatively" easily. However, the use of any such framework requires rather good command of the programming language (C++). Are you there yet?
One does not need to use GUI frameworks. One can learn esoteric low-level OS-dependent incantations and implement every last detail oneself. There are reasons why that is not a common hobby.
i don't want to open the file on the terminal but i want the file to open on the desktop
What exactly does that mean? Do you want another application to open the generated file? If so you need system dependent functions like (windows) ShellExecute(...).
i meen when the writing is finished , i don't want to clik on the file to see what is writing , i need to find a commande with c++ that can open the file automatically after the writing is finished is that possible
thanks for your replay :)
Do note that using system is, all things considered, a pretty dangerous and uncontrolled way to do this. That thread suggests other functions to use.
I suggest that you get it working with system, as in that thread, and then when the excitement has worn off, learn why using system is dangerous and expensive, and learn how to do it better.
Does "raspberry carte" have "notepad.exe"? I bet not. Does it have some other GUI text editor? Most likely. What editor do you use to write code on raspberry?
What do you think that the double click on an icon representing a file actually does?
It executes some associated command, usually external program and adds filename as command line argument to the command.
Why the program creating the file should open it for you?
You could have a shell script that first runs your program and then starts leafpad (or whatever).