Wednesday, 9 November 2011

[C] Running C Codes in Windows

Just a quick post to rectify some problems you might face in coding, as I did in the first time.

You might see the black console appear once the code compiles then it disappears quickly. This happens if you're using a Windows computer and there's a hack to it.

In your main function, add the line 'system("pause");' before 'return 0;'

int main ( )
{
    //Code here
 
   system ("pause");   
    return 0;
}    

For Dev C++ or wxDev C++, to compile and run a file, press F9. That's a good shortcut.

No comments:

Post a Comment