populating array from while loop

hi,

how can I populate a given array from while loop. and print out to screen?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
        unsigned long long int ip;
	unsigned long long int delta = 100000000;
	unsigned long long int pmax = 300000000;
        unsigned int *data;
	data = (unsigned int*)malloc(sizeof(int) * size); //declare array of data
  while (ip < pmax)
			{
	unsigned long long int next = ip + delta;
	if (next > pmax)
	next = pmax;
	ip = next;
								
      }

data[i] = ip;




thanks!
You can edit this similar program for your requirements if you wish:
http://www.cplusplus.com/forum/beginner/209742/#msg985937
nice one! i forgot the for loop. :-)

thanks again!
Topic archived. No new replies allowed.