• 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: How are stdlib.h and time.h imported?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How are stdlib.h and time.h imported?


  • Subject: Re: How are stdlib.h and time.h imported?
  • From: Boris Remizov <email@hidden>
  • Date: Tue, 21 Aug 2007 10:51:32 +0400

Its standard behavior of gcc and other compilers. It looks in the well known places for header (eg. /usr/include ) and static libraries (/usr/lib) automatically.

On Aug 20, 2007, at 22:37 , Frank Bettger wrote:

Started to read Hillegass book,

In his first example he uses three C functions random() , srandom and
time(). But he doesn't explain much where they come from or how the compiler
finds them. Not knowing so much about C, I tried to look them up from Xcode
by choosing Help->Documentation and then searching for these words. Here's
what I've found.


#include <stdlib.h>
long random(void);
void srandom(unsigned long seed);

#include <time.h>
time_t time(time_t *tloc);

Here is my question

How does the compile find random() and time(). According to the docs you
should import stdlib.h and time.h, but Hillegass code does not import any of
them. The only thing imported in Hillegass code is <Cocoa/Cocoa.h>, and I've
looked in that file and do not see any imports of time.h and stdlib.h?


Thanks Frank
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How are stdlib.h and time.h imported?
      • From: Andrew Farmer <email@hidden>
References: 
 >How are stdlib.h and time.h imported? (From: "Frank Bettger" <email@hidden>)

  • Prev by Date: Re: Notifying when a key is pressed and perform default tasks.‎
  • Next by Date: Re: How are stdlib.h and time.h imported?
  • Previous by thread: Re: How are stdlib.h and time.h imported?
  • Next by thread: Re: How are stdlib.h and time.h imported?
  • Index(es):
    • Date
    • Thread