Re: How to pass a struct to a function
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Wed, 28 Mar 2007 15:31:11 +0000
Bill said:
<snip>
Here is what I have so far, won't even compile. And I am:
#include <stdio.h>
#include <string.h>
int AddEntry(struct entry);
struct{
char fName[51];
char lName[51];
char Phone[13];
}Entry;
You'll want to make this:
struct entry {
char fName[51];
char lName[51];
char Phone[13];
} Entry;
or, more clearly:
struct entry {
char fName[51];
char lName[51];
char Phone[13];
}; /* defines a type called 'struct entry' */
struct entry Entry; /* creates an object of that type */
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
.
- References:
- How to pass a struct to a function
- From: Bill
- Re: How to pass a struct to a function
- From: Chris Dollin
- Re: How to pass a struct to a function
- From: Bill
- How to pass a struct to a function
- Prev by Date: Re: How to pass a struct to a function
- Next by Date: Re: question about k&r2
- Previous by thread: Re: How to pass a struct to a function
- Next by thread: Re: How to pass a struct to a function
- Index(es):
Relevant Pages
|