@ xpi0t0s ::
Read what the conversation was all about b4 posting your view.
Mridula and I were discussing about the
2nd program I posted, not the first one. I had mentioned that you don't need to #include <stdio.h> and Mridula says we must. -- THAT was the topic.
And, I was requesting Mridula to post proof of that code.
--------------
As I said earlier, the code I posted earlier (the one considered as the winning entry) would not compile on recent gcc compilers because of the "void main". The missing quotes was a typo. But even after adding missing quotes, the program won't work (as explained
here).
And so, I mentioned another
shortest Hello G4EF code (which is still the shortest, if my previous entry is rejected.) Now here is the proof that it works ::
I made a batch file with the following contents ::
Code:
PROMPT Time$S$Q$S$T$S$G$S
TYPE hello.c
mingw32-gcc -E hello.c
mingw32-gcc hello.c -o test.exe
test.exe
pause
The first line changes the DOS prompt to indicate the time to milli-second accuracy.
(So that you would believe I haven't changed things in between.)
The next line(2) prints the contents of hello.c.
The next line(3) prints the contents of hello.c after pre-processing by MinGW.
Finally the file is compiled to test.exe and it is executed.
Now, here is the output :
TEXT ::
Code:
D:\MinGW\bin>PROMPT Time$S$Q$S$T$S$G$S
Time = 19:01:17.65 > TYPE hello.c
main(){puts("Hello G4EF");}
Time = 19:01:17.65 > mingw32-gcc -E hello.c
# 1 "hello.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "hello.c"
main(){puts("Hello G4EF");}
Time = 19:01:17.68 > mingw32-gcc hello.c -o test.exe
Time = 19:01:17.82 > test.exe
Hello G4EF
Time = 19:01:17.84 > pause
Press any key to continue . . .
SCREEN-SHOT ::
@ Mridula :
I don't know why it gives that error on linux system.
Look at the screen-shots I gave above (done in Windows XP SP3). May be linux gives that error 'cuz of the missing return 0. Can you plz test this then :
Code: C
main(){puts("Hello G4EF"); return 0;}
I hope this satisfies everyone.
BTW, I had mentioned in my very first entry that I have "
NOT" tested the code.
So, if I was declared the winner, it's not my fault and btw, now I have proved that I have come up with the shortest code

(Guess that's fair enough)