===================================
main.c
===================================
#include
#include
#include
#include
#include
#include "keyword.c"
int ncomp = 0;
#define MAXCOMPARE 5
int mystrcmp(const void *a, const void *b)
{
ncomp++;
return strcmp(* (char **) a, * (char **) b);
}
void shuffle(char **keyword, int size)
{
int i;
int k1;
int k2;
char *x;
for(i = 1; i < size*10; i++)
{
k1 = rand() % size;
k2 = rand() % size;
x = keyword[k1];
keyword[k1] = keyword[k2];
keyword[k2] = x;
}
}
int main()
{
char **keyword;
int i;
int count;
keyword = keyword2;
count = sizeof(keyword2)/sizeof(4);
shuffle(keyword, count);
for(i = 0; i < count; i++)
{
printf("%s\n", keyword[i]);
}
printf("\n");
return 0;
}
===================================
keyword.c
===================================
char *keyword2[]={
"가학",
"가합",
"가항",
};