Beruflich Dokumente
Kultur Dokumente
name Simon
my_student studentID 0078
major CS
struct student{
char name[20];
int id;
};
void display(struct student); /* function prototype */
int main(void)
{
struct student student1;
strcpy(student1.name, "Ahmad"); /*initialising variable */
student1.id = 12345; /*initialising variable */
display(student1);
return 0;
}
For example:
void Read(struct student *s1)
{
s1->studentID = 10179;
scanf(%s, s1->name);
}
}
}
Read(list);
found = Search(list);
if (found == TRUE)
printf(FOUND!!);
else
printf(Cannot find the requested item);
}
#include <stdio.h>
enum months {JAN = 1, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP,
OCT, NOV, DEC};
void main ( ) {
enum months month;
char *monthsName[] = {January, February, March,
April, May, June, July, August, September,
October, November, December};