i cant write code for you at moment but you are being advised to use the malloc function, you will find lots of examples google. you declare a type pointer and later size it according to requirements then if you pass this new array to a function you use an argument for the type pointer and an int for the size then just reference as usual in the function with square brackets