This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

newbie gcc question


I have a little experience writing C++ in the dos and windows
environment. Now I am trying to write a c program and compile it in gcc
on a unix system. As a test, I wrote the traditional hello, world
program:
  #include <stdio.h>
  void main()
  {
    printf("Hello, world!");
  }

I compiled it using:
  gcc helloworld.c
Now, I have a.out, which appears to be executable.

I am using the z shell.
I tried typing:
   a.out
and got:
   zsh: command not found: a.out
so I tried
   sh a.out
and got
   a.out: (M-^A)^C^A^K: not found
   a.out: syntax error at line 10: `;;' unexpected
finally, I tried
   ./a.out
and got nothing in response

I feel abysmally stupid. How can I execute my program?
Thanks in advance


--
Autoreplies will (hopefully) bounce. To reply to me, please send mail
to mmowens at panix dot com.


Sent via Deja.com http://www.deja.com/
Before you buy.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]