CSE2305 - Object-Oriented Software Engineering
Week 3

Topic 5: Revision of C Fundamentals


Synopsis


Why Revise C


Structs


Struct field access


Function prototypes

 

Example: unspecified number of arguments

int printf(const char* ...);

printf("There is only a char* variable here.\n");
printf("There are %d extra variables here: %f\n", 2, myFloat);

How is the software written so that it can "know" how many variables have been passed to printf()? Where will the variables be read from if they don't have a name? Are any special header files needed? ...find out the answers to these questions by doing some research!


 


File-based modularity¤


Static variables and functions


Function pointers


Function pointers and polymorphism¤


Reading


This material is part of the CSE2305 - Object-Oriented Software Engineering course.
Copyright © Alan Dorin, Jon McCormack, Damian Conway, 1998–2006. All rights reserved.