is array size limited?

Hi,

When i run the program below with the array size as 255,the random values are getting stored in the value array correctly.But if I increase the size of the array to 256 only '0's'(zeros) are getting stored at all the locations?How can I overcome this error?
is there any limitation for the size of the array in keil?

looking for ur help,
t.senthil

	#include <stdio.h>
	#include <stdlib.h>
   #include <LPC22xx.h>

	void main (void)
	  {



	 unsigned int values [255],i;
	  for (i=0;i<255;i++)
	  values[i]=rand()%100;

	  }

Parents
  • "'0's'(zeros) are getting stored at all the locations"

    How do you determine that?

    Are you sure that your entire loop isn't just being optimised away?

    "is there any limitation for the size of the array in keil?"

    Implementation details like that will be in the Manual; be sure to read the correct manual - GNU, CARM, or Realview...

Reply
  • "'0's'(zeros) are getting stored at all the locations"

    How do you determine that?

    Are you sure that your entire loop isn't just being optimised away?

    "is there any limitation for the size of the array in keil?"

    Implementation details like that will be in the Manual; be sure to read the correct manual - GNU, CARM, or Realview...

Children
More questions in this forum