I'm working on a bunch of sorting algorithems. I need to sort an array of x numbers.
Unfortunately I stumbled acros a problem.
If I make an random array of numbers below 10. There are some large numbers passed in that i didn't declare.
This is my code:
int quantity = 10;
list[]={};
void randomarray(quantity)
{
for (int i=0; i< quantity; i++)
{
int randint = random(0,quantity);
list = randint;
}* } If I print the array i get something like this: 3 1 261 2 514 8 777 5 0 8 Where in earths name do these large numbers come from? I can't figure it out!
and also use code button for source code to be better readable.
EDIT: You've printed a random memory regions since list = randint; command changed a pointer to array not a value inside of array.
and also use code button for source code to be better readable.
EDIT: You've printed a random memory regions since list = randint; command changed a pointer to array not a value inside of array.
In fact it's the lack of code tags that took out the i index in square brackets and turned on italics instead.