Hi Leigh:

Disclaimer: No C Guru :)
But this might help:

#include <stdio.h>   <-- this looks useful
void main()
{
      printf("Hello World\n");
}

also a quick Google turns up a raft of online tutorials like

http://cplus.about.com/library/weekly/aa010602a.htm

HTH
David

On Sunday, December 1, 2002, at 11:14 PM, Leigh Honeywell wrote:

> This is a call-out to any C gurus on the list - I'm a newbie just
> getting started in the language (I'm in Physics in university, and all
> the internships I've looked at applying for require C knowledge) and
> I'm having trouble getting my hello world program to run.
>
> Here's the deal:  I type in the code as follows - and I've tried both
> void and int, in case that matters - I've read that it sometimes does:
>
> #include <stdio.h>
>
> void main()
> {
>       printf("Hello, World!\n");
> }
>
> Now, when I use void, I get errors in the Terminal (oh yeah, I'm using
> GCC 3.1) as follows:
>
> hello.c: In function `main':
> hello.c:4: warning: return type of `main' is not `int'
>
> When I use int, I get nothing.  No file, no errors, nothing....
>
> It's all very mysterious and discouraging, so if someone could help me
> out, I'd be endlessly grateful.
>
> Thanks,
>
>
> Leigh Honeywell
>
>    --
> First Year Physics and Equity Studies
> at the University of Toronto
>    --
> "Almost anything you do will seem insignificant, but it is very
> important that you do it."
>                     -Gandhi
>    --
>
>
> -- 
> Mac Canada is sponsored by <http://lowendmac.com/> and...
>
> Shop Canadian, visit Mantek Services          <http://www.mantek.mb.ca>
>        Low Prices That Will Keep YOU and Your MAC Smiling
>
>       Support Low End Mac <http://lowendmac.com/lists/support.html>
>
> Mac Canada info:        <http://lowendmac.com/lists/mac-can.shtml>
>   --> AOL users, remove "mailto:";
> Send list messages to:  <mailto:[EMAIL PROTECTED]>
> To unsubscribe, email:  <mailto:[EMAIL PROTECTED]>
> For digest mode, email: <mailto:[EMAIL PROTECTED]>
> Subscription questions: <mailto:[EMAIL PROTECTED]>
> Archive: <http://www.mail-archive.com/mac-canada%40mail.maclaunch.com/>
>
> Using a Mac? Free email & more at Applelinks! http://www.applelinks.com
>


-- 
Mac Canada is sponsored by <http://lowendmac.com/> and...

Shop Canadian, visit Mantek Services          <http://www.mantek.mb.ca>
       Low Prices That Will Keep YOU and Your MAC Smiling

      Support Low End Mac <http://lowendmac.com/lists/support.html>

Mac Canada info:        <http://lowendmac.com/lists/mac-can.shtml>
  --> AOL users, remove "mailto:";
Send list messages to:  <mailto:[EMAIL PROTECTED]>
To unsubscribe, email:  <mailto:[EMAIL PROTECTED]>
For digest mode, email: <mailto:[EMAIL PROTECTED]>
Subscription questions: <mailto:[EMAIL PROTECTED]>
Archive: <http://www.mail-archive.com/mac-canada%40mail.maclaunch.com/>

Using a Mac? Free email & more at Applelinks! http://www.applelinks.com

Reply via email to