• 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: A very lame question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A very lame question


  • Subject: Re: A very lame question
  • From: Chris Espinosa <email@hidden>
  • Date: Thu, 28 Jul 2005 21:38:44 -0700


On Jul 28, 2005, at 8:18 PM, Chris Espinosa wrote:

In the application X Code there is a tutorial called "Hello World." In "Editing Project Files" the instructions say to add the code "Print Hello" to the "main.c" code.
My question is "What would I do differently to put this code on a seperate file and then include that new file in the project.
Thanks;

File > New File...

Select C file from the list

Call it Hello.c.  Make sure to add Hello.h.

In Hello.h enter:

void PrintHello(void);

In Hello.c enter:

void PrintHello(void) {

	printf("Hello World!");

};


Save both files, then build and run.

And, of course, in main.c, you'd

#include "Hello.h"

and in main() you'd call PrintHello().

Chris

_______________________________________________
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: 
 >A very lame question (From: Carl Anderson <email@hidden>)
 >Re: A very lame question (From: Chris Espinosa <email@hidden>)

  • Prev by Date: Re: Subversion over SSH
  • Next by Date: Re: Subversion over SSH
  • Previous by thread: Re: A very lame question
  • Next by thread: Re: Xcode-users Digest, Vol 2, Issue 389
  • Index(es):
    • Date
    • Thread