I'm new to C. I'm trying to think of a way that I can ask a user to define the length of an array. Can yall give me an example for doing this? I know this dosnt work as it gives me a segmentation fault. Just need an example so I can rewrite my code. Thanks!
case 3:
srand(time(NULL));
printf("How many time do you want to roll a dice? ");
scanf("%d", &DiceRoll);
for (k = 0; k < DiceRoll;++k)
{
MyArray[p] = rand()% 6 +1;
}
DiceFill(MyArray,DiceRoll);
break;