Learn How to Program in C

by
Dr. Kristin Switala

Introduction

Directives

Variables

Conditionals

Loops

Arrays

Pointers

Strings

Functions

Structures


Site Map

Answers to Review: Pointers (c)


General Questions

1. the address of a variable

2. int *point = NULL;

3. to give the value of the variable, instead of the value of the pointer


White Box Testing

1. two errors:

  • in line 5, add a * before point: int *point = NULL;
  • in line 6, add an & before shoes: point = &shoes

2. two errors:

  • in line 7, the first format specifier should be %d instead of %p: printf("\n%d\tNumber's Value
  • in line 8, the last variable should be &point

3. two errors:

  • in line 5, the variable should be long *point instead of int *point
  • in line 10, change pont to point

4. two errors:

  • line 8 should be *point = eggs * 4;
  • in line 9, the variable should be eggs instead of point
Copyright
© 2001
Kristin Switala
Hosted by www.Geocities.ws

1