In Xcode how does one create a header file? and what should it include? or does xcode create the file and use the information from the .c file to create the .h file

New to C programming are we? You need to learn how C program files use headers to describe/define structures and interfaces. This is basic computer science and programming 101. For example, if I have a C source file that implements some API (functions) that other programs may use, I will create a header file that specifies the signature of the functions (API) so other applications can use them. Example:

#ifndef MY_C_HEADER_H
#define MY_C_HEADER_H

typedef struct {
int int_member1;
char array_member2[100];
} mytype_t;

extern void myfunction(int arg1, const mytype_t* pArg2);
.
.
.
#endif /* MY_C_HEADER_H */

In this case I am defining a structure and making it a proper type (mytype_t), and then I am declaring that my code includes the function myfunction(...), in a manner that other programs can use it if they link to my code.

If you don't understand all of what I am saying here, you have some serious studying to do... :-)

Good luck!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.