Appendix: Advanced C Data Types

Diomidis Spinellis
Department of Management Science and Technology
Athens University of Economics and Business
Athens, Greece
dds@aueb.gr

Pointers

Used:

Structures

Used:

Unions

Used:

Dynamic Memory Allocation

typedef Declarations

Further Reading

Exercises and Discussion Topics

  1. If you are familiar with C++ or Java explain how it is possible to minimize (in C++) or avoid (in Java) the use of pointers.
  2. How does a C pointer differ from a memory address? How does that affect your understanding of code? Which tools take advantage of the difference?
  3. How can a program using structures to specify a memory layout ensure that they are correctly allocated?
  4. How would you translate a program using unions into Java?