C Programming

prev next

Practise Exercise 10: Pointers

Only use this if you have a forms compatible browser [Note: You must have an Internet connection in order to have these tests marked]


1. Declare a pointer to an integer called address.

2. Assign the address of a float variable balance to the float pointer temp.

3. Assign the character value 'W' to the variable pointed to by the char pointer letter.

4. What is the output of the following program segment?


	int  count = 10, *temp, sum = 0;

	temp = &count;
	*temp = 20;
	temp = ∑
	*temp = count;
	printf("count = %d, *temp = %d, sum = %d\n", count, *temp, sum );

5. Declare a pointer to the text string "Hello" called message.


To submit your comments, press this button:

To clear the form, press this button:


©Copyright B Brown. 1984-1998. All rights reserved.
prev next