60 likes | 219 Views
Welcome to CS1550 Recitation. Class information: http://cs.pitt.edu/~zdk/cs1550/ CRN 12725: Friday 11am – 11:50am CRN 12733: Friday 2pm – 2:50pm TA: Dakai Zhu (zdk@cs.pitt.edu) Office time: 6507 Sennott Square Thursday 2pm – 5pm Friday 3pm – 4pm By appointment. Outline of this class.
E N D
Welcome to CS1550 Recitation • Class information: http://cs.pitt.edu/~zdk/cs1550/ • CRN 12725: Friday 11am – 11:50am • CRN 12733: Friday 2pm – 2:50pm • TA: Dakai Zhu (zdk@cs.pitt.edu) • Office time: 6507 Sennott Square • Thursday 2pm – 5pm • Friday 3pm – 4pm • By appointment
Outline of this class • C and Pointers • How Makefile works? • Test your working environment • Login your CIS account • Write a simple program • Compile the program and execute it
C and Pointers • Variables: names of int, char etc • Vaule can vary • int k; k=2; … ; k=3; • Compilation: • Allocate a piece of memory: int 4 bytes • Symbol table: k and the address in memory • k: the value and it’s location in memory • Pointer variables • int *ptr; ptr =&k; • Hold variable’s address/location in memory • References • http://pw1.netcom.com/~tjensen/ptr/pointers.htm
Makefile • Manage compilation of programs • The steps of a compilation • Makefile; file.c cc file.c
Compile multiple files • Two files • green.c and blue.c Single step: cc green.c blue.c Separate steps: cc –c green.c green.o cc –c blue.c blue.o cc green.o blue.o a.out
Dependences • main.c ; io.c; io.h; data.c; data.h • References • http://www.eng.hawaii.edu/Tutor/Make/index.html