#include <stdio.h>

struct assignment6{
int num;
char ch;
int num_array[10];
char name[30];
int* int_ptr;
char* char_ptr;
};

typedef struct assignment6 assign6;

assign6 enterdata(assign6 var);
void showdata(assign6 var);

int x=0;
int y;

int main ()
{
int request;
assign6 inst1,inst2,inst3,inst4,inst5;

for (int x=0; x<5; x++)
{
thingy[x].num=0;
}

do
{
printf("Enter the instance you wish to modify or Press 9 to quit");
scanf("%d",request);
switch (request)
{
case 1:
{
enterdata(&inst1);
inst1.num = 1;
inst1.ch = 'A';
inst1.int_ptr=&(inst1.num_array[4]);
inst1.char_ptr=&(inst1.name[4]);
}
case 2:
{
enterdata(&inst2);
inst2.num = 2;
inst2.ch = 'B';
inst2.int_ptr=&(inst2.num_array[4]);
inst2.char_ptr=&(inst2.name[4]);
}
case 3:
{
enterdata(&inst3);
inst3.num = 3;
inst3.ch = 'C';
inst3.int_ptr=&(inst3.num_array[4]);
inst3.char_ptr=&(inst3.name[4]);
}
case 4:
{
enterdata(&inst4);
inst4.num = 4;
inst4.ch = 'D';
inst4.int_ptr=&(inst4.num_array[4]);
inst4.char_ptr=&(inst4.name[4]);
}
case 5:
{
enterdata(&inst5);
inst5.num = 5;
inst5.ch = 'E';
inst5.int_ptr=&(inst5.num_array[4]);
inst5.char_ptr=&(inst5.name[4]);
}
case 9: break;
default: printf("You did not enter 1-5 or 9 run program again.\n");
}
}
while (request != 9);
for (x =0; x<5; x++)
{
printf("This is instance %d",x);
showdata(thingy[x]);
}
return 0;
}


assign6 enterdata(assign6 var)
{
for (x=0; x<10; x++)
{
printf("Enter the entry number %d for the array:",x);
scanf("%d",&(x->num_array[x]));
}
for (x=0; x<30; x++)
{
printf("Enter a string:");
scanf("%c",&(x->name[x]));
}
return x;
}



void showdata(assign6 var)
{
int tmp;

if (var.num == 0)
{
printf("This Instance is Empty");
}
else
{
for(x=0; x<9; x++)
{
for (int y=1; y < 10; y++)
{
if (var.num_array[y] < var.num_array[x])
{
tmp = var.num_array[y];
var.num_array[y]=var.num_array[x];
var.num_array[x]=tmp;
}
}
}

printf("The sorted array is:");

for (x=0; x<10; x++)
{
printf("%d ", var.num_array[x]);
}

printf("The Reverse String Is:");

for (x=29; x>=0; x--)
{
printf("%c ",var.name[x]);
}

printf("The fifth element of the integer array is located at %d",var.int_ptr);
printf("The fifth element of the string is located at %d",var.char_ptr);
}
}


this is my code, here is the link....

http://www.cs.ucf.edu/~riqbal/assign6.html

we are getting only errors, and very frustrated

here are the errors:

6test.c: In function `main':
6test.c:29: parse error before `int'
6test.c:29: parse error before `)'
6test.c: At top level:
6test.c:37: parse error before string constant
6test.c:37: warning: data definition has no type or storage class
6test.c:88: parse error before `['
6test.c:88: conflicting types for `showdata'
6test.c:15: previous declaration of `showdata'
6test.c:88: warning: data definition has no type or storage class
6test.c:95: conflicting types for `enterdata'
6test.c:14: previous declaration of `enterdata'
6test.c: In function `enterdata':
6test.c:106: incompatible types in return
6test.c: At top level:
6test.c:112: conflicting types for `showdata'
6test.c:88: previous declaration of `showdata'
6test.c: In function `showdata':
6test.c:123: parse error before `int'
6test.c:123: parse error before `)'
6test.c: At top level:
6test.c:134: parse error before string constant
6test.c:134: warning: data definition has no type or storage class
6test.c:141: parse error before string constant
6test.c:141: warning: data definition has no type or storage class
6test.c:149: parse error before string constant
6test.c:149: warning: data definition has no type or storage class
6test.c:151: parse error before string constant
6test.c:151: warning: data definition has no type or storage class