[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: Why am I not getting the results I expect...



On Thu, Jul 06, 2000 at 09:43:30AM +0530, Mrinal Kalakrishnan typed:

>         num_of_arts=24;
> 
>         article_displayed= (int *) malloc(num_of_arts*sizeof(int));
> 
>         for (i=0;i<24;i++) article_displayed[i]=i+1;
                     ^^
	should be "for (i=0;i<num_of_arts)"
> 
>         /* Fill the array with numbers from 1 to 24 */
> 
>         size_of_array=24; /* The number of remaining random numbers
>                       ^^      yet to be chosen */
	should be "size_of_array=num_of_arts"
	
Kala