(phil goddard) wrote:
> This homework tests your understanding of pointers and how to use
> pointers with arrays and functions.
> Tasks:
> 1) Include all the required libraries and define a main().
#define a main()
> 2) In main, define a
> a. float called myFloat,
a { float called, myFloat,
> initialize it with 7.11
it = 7.11,
> b. one dimensional array called testArray[10]={1,2,3,4,5,6,7,8,9,10};
testArray[10]={1,2,3,4,5,6,7,8,9,10};
> c. an int called testArraySize=10
int testArraySize=10;
> d. call the function like so:
} so() {
> 3) Define two pointers fPtr and aPtr and initialize them to point to
> the float and the array
char *fPtr = "the float and the array";
char *aPtr = fPtr;
> 4) Define another pointer called resultPtr,
#define resultPtr
> type int*,
int*
> initialize it to NULL
it = NULL;
Should all compile just fine. Now that I've given you a start,
you should be able to finish it off yourself.