Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

I want to display my c++ file output as a .exe how can i do that

+2 votes
asked Dec 18, 2022 by charukesh naiknaware (170 points)

2 Answers

0 votes
answered Dec 21, 2022 by Ericsson Lin (600 points)
selected Dec 21, 2022 by charukesh naiknaware
 
Best answer
As Peter Minarik said, there is no exe on this site. However, if you were referring generally to how one can output to a file instead of standard out, then you can use freopen.

#include <cstdio.h>

#include <iostream>

int main() {

    freopen("foo.out", "w", stdout);

}
0 votes
answered Dec 19, 2022 by Peter Minarik (86,180 points)
The compilation happens on a server. Online GDB does not give you the option to grab the binary from the server.

Furthermore, the server is a Unix-based server, there are not .exe files there (that's for Windows operating systems).
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...