Re: A very lame question
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