I'd prefer C to automatically eliminate the part out of the bounds because it will be hard to rearrange my code so that I won't go out of bounds. But here I have to do.. Thanks for the information.
Type: Posts; User: farukyaz
I'd prefer C to automatically eliminate the part out of the bounds because it will be hard to rearrange my code so that I won't go out of bounds. But here I have to do.. Thanks for the information.
So there's no way of nondisplaying the part of my array that is out of the bounds, rather than crashing the program.. Gotta write the whole thing over again now.
Okay I will write things in...
I do not, because my mind doesn't work correctly now. I wanted to make zero the array elements for which my code calculates an index less then zero or larger then number-1 (which is actually 11). So...
I would accept if the program writes zero instead of not displaying them. So I simply wrote this code to assign zero value to all of the array elements out of range.
if(k>number-1 || k<0)
{
...
Here is the concerning part of the code:
for(a=1; a<=machines; a++)
printf(" %d machine: %d, %d, %d, %d\n", a, sort[number-a], sort[number+a-(2*machines)-1], sort[number-a-(2*machines)],...
I have written a code that outputs a series of numbers, where these numbers are elements of the array. But I have problem for large ranges of this array. System uses random variables for the array...