// String Functions
//
#include <stdio.h>
#include <string.h>
#define MAX_STUDENTS 5
#define MAX_LETTERS 30
void bubble(char [][MAX_LETTERS+1], int);
int main(void)
{
int noStudents;
char student[MAX_STUDENTS][MAX_LETTERS+1];
return 0;
}
void bubble(char a[][MAX_LETTERS+1], int size)
{
int i, j;
char temp[MAX_LETTERS+1];
for (i = size - 1; i > 0; i--) {
for (j = 0; j < i; j++) {
if (strcmp(a[j],a[j+1]) > 0) {
strcpy(temp, a[j]);
strcpy(a[j], a[j+1]);
strcpy(a[j+1], temp);
}
}
}
} |