Originally Posted by
biccat
#include <stdio>
#define MAX_STRING_LENGTH = 20
#define MAX_GRADE = 12
#define IS_DORK = 1
#define IS_JOCK = 2
#define IS_ROCKER = 3
#define IS_PARTIER = 4
#define IS_OTHER = 5
struct student
{ char name[MAX_STRING_LENGTH]; int grade; short int status; int rank; }
int main()
{
char buf[MAX_STRING_LENGTH];
int i;
struct student biccat {"", 12, 1, 100};
strcpy("biccat",biccat.name);
for(i=0;i<IS_OTHER;i++)
if (biccat.status == i)
break;
switch i
{ case IS_DORK:
strcpy("dork",buf);
break;
case IS_JOCK:
strcpy("jock",buf);
break;
case IS_ROCKER:
strcpy("rocker",buf);
break;
case IS_PARTIER:
strcpy("partier",buf);
break;
default:
strcpy("other",buf);
break;
}
printf("%s was a %s in high school.",biccat.name,buf);
return 0;
}