?
2010-02-03 14:14:59 UTC
Now I'm new to programming so its very confusing for me.
This is the easiest problem on the handout yet I still do not know how to do it.
The teacher didnt even give us examples to follow or anything so that is why I am asking for a fully detailed explanation for help with this problem.
(I was sick and could not go to tutoring today :[ )
Here it is:
Write a program using pointers to implement a solution to the following problem:
a) Create a memory block to store 30 doubles (use the modified "Memory allocation for n integers" idiom)
b)Read in up to 30 doubles from the standard input; stop reading when any of the following conditions are true (using the "Block traversal with a sentinel" idiom)
(1.) 30 doubles have been read
(2.) End of file has been reached
(3.) A negative value has been encountered
c) find the maximum double value stored in the block
Please help me learn =(