beginner code question

Posted:
in macOS edited January 2014
I am using Xcode to learn C from a windows-oriented "teach yourself" book. The executable file for the Hello World! program ends in .exe. I imagine that this would run if you double-clicked it in a windows operating system. Is there an equivalent extension for the mac?



Or is it always only ran through the terminal program in the Xcode program?



Thanks, sorry for the newbie questions.

Comments

  • Reply 1 of 3
    Quote:
    Originally Posted by gatmang View Post


    I am using Xcode to learn C from a windows-oriented "teach yourself" book. The executable file for the Hello World! program ends in .exe. I imagine that this would run if you double-clicked it in a windows operating system. Is there an equivalent extension for the mac?



    Or is it always only ran through the terminal program in the Xcode program?



    Thanks, sorry for the newbie questions.



    It's .app. Mac OS X application is actually folder containing executable itself (doesn't need to have extension, it's all managed by permissions) and resources inside.

    Xcode is much like Windows IDEs it compiles and then runs built applications just upon clicking the button, too.
  • Reply 2 of 3
    For plain C based console I/O programs, Unix based operating systems don't use a suffix for the executable. You can name it whatever you want. By default, gcc produces "a.out". If you are just learning C programming, pick a Unix based book. It will match what you see in OS X.



    The ".app" extension is for OS X GUI application bundles.
  • Reply 3 of 3
    hirohiro Posts: 2,663member
    ivan beat me to it. don't know how I missed his post 1st time around???
Sign In or Register to comment.