Hi everyone in this program down below in the while loop it works the first time, but when it goes back to start of the loop again, it skips the first question of the loop all the time, and it wont let me enter it again, it just skips it
can you please help me why this wont let me do it or fix it up for me =) thanx heaps
Rob
#include <stdio.h>
#include <string.h>
#define MAX 100
/* size of structure array */
typedef struct {
char name[ 20 ];
char phone [ 15 ];
char studentid [ 15 ];
} customerData;
void bubblesort(customerData[]);
int main()
{
customerData customer[MAX];
customerData hold;
int i, pass, element;
char targetName[ 20 ];
int s;
printf("Enter students records (names and phone no.).\n");
printf("\nThey will then be sorted by names.\n\n");
while ( s != 0)
{
printf( "\nEnter customer lastname Then First name (E.g. Jones John): ");
gets ( customer[i].name );
printf( "\nEnter phone number: " );
gets( customer[i].phone );
printf( "\nEnter Student ID: ");
gets( customer[i].studentid);
printf( "With to enter anymore?(1 for YES, 0 for NO)\n ");
scanf("%d", &s);
}
}