Hi, i have this code, but it gives me blank screen when i run it.
Code:
#include<stdio.h>
#include<string.h>
#include <stdlib.h>
#include <time.h>
int main()
{
char message[10][150],buffer[150];
int i=0;
int cntr=9;
int freeArray[9];
srand(time(NULL));
for (i=0;i<cntr;i++)
freeArray[i]=rand()%cntr;
FILE *file_in;
file_in=fopen("test.txt", "r");
while(fgets(buffer,150,file_in)){
strcpy(message[freeArray[i]], buffer);
}
while(cntr>=0)
{
i=rand() % cntr;
strcpy(message[freeArray[i]], buffer);
freeArray[i] = freeArray[cntr--];
printf("%s", message[freeArray[i]]);
}
return 0;
}