dynamic array

i want make a code for the following scenario

write a function int* generate_rand (int length, intMAX_ARRAY) that gets an integer as input and generates a dynamic array with the same number of elements, fills the array with random values between 0 and MAX_ARRAY and returns a pointer to this array.

pleas any idee
What part are you having trouble with? Please show that you've made an effort to solve this yourself, otherwise most of us will think you're just looking for someone to do it for you.

i have just searched about dynamic array i m now busy to solve this myself
i m nieuw in this forums.
thank u
That's not a difficult task, you just need a loop to fill the dynamically allocated array

http://www.cplusplus.com/doc/tutorial/dynamic.html
http://www.cplusplus.com/doc/tutorial/control.html#for
Topic archived. No new replies allowed.