Tuesday, July 28, 2009

Programming questions(c++)?

for c++





1. Write the statement, which declares a pointer to an integer data-type. Name the pointer 'd_address'.








2. Write a function definition header named 'return_address' which returns a pointer to a dynamically created array of integers. The function should receive an integer in a variable named 'numbers'.


Note: do not write the code for the function block, only the header!














3. Write the statement, which dynamically creates a new array of integers. The number of elements for this array should be 'numbers'. The address of this new array should be assigned to pointer variable 'd_address'.


Assume that 'd_address' is already declared.














4. Rewrite the following in pointer notation. Use the simplest form, assuming that this call is not part of a loop; in other words, do not include a counter which would reach the zero element:


array[0] -

Programming questions(c++)?
How far did you get?





What parts are you having trouble with?





It seems pretty straight forward, so I'll need convincing as to why I should do your homework.

garland flower

No comments:

Post a Comment