Minggu, Januari 12, 2014

The Simplest C Program

If in Pascal programming, the simplest program is:

begin

end.

then in C programming, the simplest program is:

main(){}

Please try:
  • Open Dev-C++ program
  • Create new file: Menu File > New > Source File
  • Save file: Menu File > Save As > choose file saving location folder > Save as type: C sources files (*.c) > Give file name, e.g. simplest-program.c > Click on Save
    Now in file saving location folder has been created simplest-program.c file
  • On Dev-C++ program, on the simplest-program.c file, write main(){}
  • While check at file saving location folder, action on Dev-C++ program , on simplest-program.c file: Menu Execute > Compile, then new file ile baru extensioned .exe (simplest-program.exe) will be created, then compile progress window will be showed as follows:

    Click on Close on Compile Progress Window
  • And when try to be run: Menu Execute > Run, then will be showed a black/empty window in which the window will close again immediately, only showed for a moment, so to see it don't blink eyes, hehe...
    Why the window is empty? Cause there is no contained whatever, it is the simplest C program, only writen main(){}, there is no program in sign of {}
  • Hm..., how to make the program when be run will not close by self? Please see the solution here

Source:
Article gotten from google

correction please... : )

0 komentar: