[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Hello World doesn't work



On 28 Nov 1998, Ole J. Tetlie wrote:

> *-Havoc Pennington <rhpennin@midway.uchicago.edu>
> |
> | On Fri, 27 Nov 1998, Kent West wrote:
> | > 
> | >   main()
> | 
> | A long shot, but technically the above is illegal; you have to do:
> | int main(int argc, char* argv[])
> 
> It can also be 'int main(void)', which is equivalent to 'main()'.
> 
> | then return something from main, or call exit().
> | 
> | maybe the lack of a return or exit call from main prevents the io buffers
> | from getting flushed? 
> 
> Kent, try the following on the troublesome computer:
> 
> #include <stdio.h>
> 
> int main(void)
> {
>   printf("Saluton!\n");
>   fflush(stdout);
> 
>   return 0;
> }
> 
> 

Thanks to everyone for the help. The problem turned out to be a simple
combination of things.
 1) I had my "/" backwards on my "\n"ewline character, which by itself
wouldn't have really been a problem.
 2) I have an ANSI-enhanced, colorized prompt with a newline character
(but no linefeed char) which immediately clobbered the output of the
"Hello, World" program.

Once I got my slash turned around I got the expected results.

Again, thanks all!

-- 
Kent West
kent.west@infotech.acu.edu
KC5ENO - Amateur Radio: When all else fails.
Linux - Finally! A real OS for the Intel PC!


Reply to: