struct student
{
char name[20];
int age;
int id;
};
struct student *sp, st[3],temp
;
void sort(struct student *p)
{
*sp=st[0];
p->age;
for(i=0; i<3; i++)
{
if(st[i].age<st[i+1].age)
continue;
else
if(st[i].age>st[i+1].age)
{
temp=st[i];
st[i]=st[i+1];
st[i+1]=temp;
}break;
}
}
/* switch case junk */
case 1: /* sort by age */
sort(sp);
continue;
ok, i think i have the alogorithm correct now, b/c it works when i put directly into a case under the switch. yet, i have failed to understand what to do with pointers and all that to pass the structures through the function. sry, about the multiple posts, im sure u guys are getting just as annoyed as i am now :-|