I want the code below to shuffle alphabet letters that are in the array.
The code works but as it shuffles, it produces doubles and triples of some letters and I end up with an alphabet that is missing some letters while
at the same time has doubles and triples of some.
I don't understand why!
Can anyone help?
Thank you.
1 2 3 4 5 6 7 8 9 10 11 12
int num=atoi(argv[1]);
srand(num);
int i, j;
char tmp;
char arr[26]={'a','b','c','d',....etc};
for(i=0;i<26;i++){
j=rand()%26;
tmp=arr[i];
arr[i]=arr[j];
arr[j]=tmp;
}