0

I am trying to learn C and I have just installed Xcode on my Mac. I wanted to run the first program that was already written

#include <stdio.h> 

int main(int argc, const char * argv[])
{

    // insert code here...
    printf("Hello, World!\n");
    return 0;
}

and got build failed. I created a program in C. The libraries have been downloaded. Thanks

JW8
  • 1,496
  • 5
  • 21
  • 36
user1347096
  • 165
  • 2
  • 4
  • 10
  • 1
    Welcome to the site. Could you please explain the "...and got build failed" part in more detail? What was the error message? You can edit your question to provide this detail, it's very important to figuring out what's going on. – Sergey Kalinichenko Apr 20 '12 at 17:14
  • FYI, use +K to mark code to have code formatting - I've removed the space in the include for you. – JW8 Apr 20 '12 at 17:15
  • 1
    Usually `argv` is `char *argv[]`, not `const char *argv[]` - even though making it const is not a problem. – ThiefMaster Apr 20 '12 at 17:17

1 Answers1

0

Are you trying to learn C or Objective-C? As far as I know, XCode is only appropriate for Objective C.

Also, can you post your compiler error, that will help alot.

Fluffhead
  • 845
  • 1
  • 9
  • 21