• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: question about xCode and C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question about xCode and C


  • Subject: Re: question about xCode and C
  • From: Robert Tillyard <email@hidden>
  • Date: Sat, 29 Jan 2005 01:57:38 +0000

You don't have anything in your code that needs a header.

If you changed printf() to fprintf (stderr, "hello\n"); then it will complain until you #include <stdio.h> to define stderr.

Regards, Rob.

On 29 Jan 2005, at 12:33 am, Michael de Haan wrote:

Dear List,

I am relatively new to  C...

I am having difficulty understanding the following: ( I am reading Brian Overland's "C in plain English")

As an illustration, he shows how to enter something like this, without anything else.

void main() {
printf( " foo bar !  \n");
}

... and explains how to C this is like any other function that needs to be defined before being used, and hence the need to add " #include <stdio.h> " in the first line.

Well, I just typed it without the # include and ......printed just fine, although I had expected to receive a warning "undefined etc etc". . I did this both in Terminal and Xcode and got the exact same warning but both printed ok......

I know there are real C gurus on the list...any explanation as to why it seems to work without adding the includes on Xcode or terminal?

Tks

_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >question about xCode and C (From: Michael de Haan <email@hidden>)

  • Prev by Date: Re: Applescripting xcode documentation
  • Next by Date: Re: question about xCode and C
  • Previous by thread: question about xCode and C
  • Next by thread: Re: question about xCode and C
  • Index(es):
    • Date
    • Thread