Making Program involving Pointers

Hey guys, New to this forum

I need some help on how to make this program as I am new in the C++ world

Write following functions

makingArray: this function will return a double pointer which points to a double array and take one parameter- an integer variable which has a default argument of 5. The argument is the size of the integer array. when the function is called, the users input or default argument will be used for the size of the array. The function will initialize all elements of the array with the 'cin' object.

getTotal: this function will return a double and take two parameters- a double array, which can NOT be modified by this function, and an integer variable for a size of the array. This function will calculate the total of all elements then return a double number which is the total.

main: demonstrate functions( makingArray and getTotal) by calling them in a program

I just need a generalize idea on how to do this if someone can right a quick program. I don't understand the pointers and arrays not to well so it would be a big help if someone can help me out.

Thanks a lot guys!

There a section in the tutorials that explains pointers and arrays which isn't too big. I would suggest reading that and see if you run into any problems.

http://www.cplusplus.com/doc/tutorial/arrays/
http://www.cplusplus.com/doc/tutorial/pointers/
Topic archived. No new replies allowed.