I have created lot of c files and i executed them,but i can run the executed files only in terminal....
can we have a direct c code,on clicking the exicuted file it should open its new window and work....
How should i create it,please help me..

Recommended Answers

All 2 Replies

It should already behave this way. However, because the lifetime of the window is tied to the lifetime of your program, you have to keep the window open long enough to see results. For example:

#include <stdio.h>

int main(void)
{
    puts("Hello, world!");

    getchar(); // Pause for input

    return 0;
}

This is for console mode programs, of course. If you want a GUI then it's a smidge more complex. ;)

On some file managers in Linux, you can specify that an executable is open in a terminal window until you specifically close it. I do that to run tools like par2repair.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.