|
-
Mar 31st, 2004, 05:44 AM
#2
Syntax
struct [<struct type name>] {
[<type> <variable-name[, variable-name, ...]>] ;
.
.
.
} [<structure variables>] ;
Example
#include <string.h>
struct my_struct {
char name[80], phone_number[80];
int age, height;
} my_friend;
void func() {
strcpy(my_friend.name,"Mr. Wizard"); /* accessing an element */
}
struct my_struct my_friends[100]; /* declaring additional variables */
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|