CS 210 ­ Fundamentals of Programming I  Fall 2012 ­ Homework 9 10 points Out: November 26, 2012

advertisement
CS 210 ­ Fundamentals of Programming I Fall 2012 ­ Homework 9
10 points
Out: November 26, 2012
Due: December 3, 2012 ­ last day of class, NO LATE WORK ACCEPTED
We will go over these homework exercises as part of the final exam review on the last day of class.
(10 points) Write C statements to do the following:
1.
2.
3.
4.
5.
6.
7.
Declare integer pointer variables named int_ptr1 and int_ptr2. Allocate an anonymous integer variable, and make int_ptr1 point to it. Input an integer value from the keyboard and stores it in the anonymous variable of question 2.
Display the value of the anonymous variable of question 2. Cause int_ptr2 to point to the anonymous variable of question 2. Declare a double pointer variable named double_ptr. Ask the user to enter n, the number of values to be processed; then allocate an anonymous array of n double values, and make double_ptr point to it. 8. Fill the anonymous array of question 7 with n input values, entered from the keyboard. 9. Deallocate the storage of the anonymous variable of question 2 and the anonymous array of question 8.
11/20/2012
Page 1 of 1
D. Hwang
Download