CS60 - Introduction to C, C++,
and UNIX
Lectures:
Lecturer - Daniel Nurmi (nurmi@cs.ucsb.edu)
Location - HSSB 1173
Time - MWF 1:00 - 1:50
Office - Phelp 1409 - M,Th 2:00pm
Discussions:
TA - Lin Tan (tan@cs.ucsb.edu)
Location 1 - HSSB 1228
Time - M 5:00 - 5:50
Location 2 - Phelp 1401
Time - F 12:00 - 12:50
Announcements
Final is Dec 9th from 4:00pm to 7:00pm in HSSB 1173 (regular lecture room)
Slight Addendum to Project 6 Posted
Project 6 Sample Output Posted
Project 6 Posted! (check back for sample output)
Class is cancelled on Friday, Nov 21st
PLEASE READ PROJECT 5 UPDATE POSTED BELOW
Homework 15 posted
Class is NOT cancelled on Wed Nov 19th, it will be held as usual at 1:00pm
project 4 solutions are posted
project 5 is posted!
hw14 posted, due Nov 17 at 1:00pm
hw13 posted due Nov 12th at 1:00pm
hw11/12 solutions posted
For the example proj4 binary, the movement keys are 'a', 's', 'd', and 'w' for 'left', 'down', 'right' and 'up respectively
Project 4 is posted!
Homework 12 is posted
Homework 11 was updated at 3:10pm on Mon Nov 3, please use the current specification, it is still due Wed. Nov 5
Project 3 sample solutions are posted
Homework 10 is posted!
NOTE: YOU MUST use system calls for hw9 and project 3, this means open(), fork(), execvp() (or some variant of exec), dup2() are the functions you need. popen(), system(), and fputs/fgets for pipes are not acceptable! You can use fgets for input from the user, but for process pipes and IO redirection, you must use system calls!
Helpful Links contains links to examples of some system calls we've used in class
Homework 9 is posted!
Project 3 is posted
Homework 8 is posted
Sample solutions for hw7 and project2 are posted
Solutions to Homework 6 and description of Homework 7 are posted
The midterm will be on Monday, Oct 20th at 1:00pm in the regular place
For the project1 extra credit, do not ask the user for the size of the board. You may use a #define to specify the size of the board, and then create three separate executable files that run the program with different board sizes
Sample Solution for hw5 is posted
Homework 6 is posted, Due MONDAY Oct 13th
For homework5, you must WRITE YOUR OWN SORTING FUNCTION! You cannot use preexisting sorting routines like qsort().
Homework 5 is posted
Sorting Algorithm Link posted in 'Helpful Links'
Sample Solution to homework 3 is posted
Lecture note, Homework 4 and Project 1 are posted, see below!
Reminder, homework 3 is due tommorrow (fri oct 3rd) at 1:00pm
Homework 3 is posted, see below
Sample Solutions to homeworks 1 and 2 are posted
The conversion specifier for a double, for both printf and scanf, is %lf, using %f will not work in scanf and may cause problems with demotion inside printf
Homework 2 is posted, see below
The computer lab you need to use for this course is the CSIL lab, located on the first floor of the Engineering 1 building. The IC lab in the Phelps building is NOT the lab we're using. You will be able to log into a CSIL machine from the Phelps lab, but all homeworks must compile,run, and be turned in from a machine in the CSIL lab.
HOMEWORK 1 IS POSTED! See below in 'Programming Assignments' to see the homework specification. Normally, small program assignments like this one will be due the next lecture, but this one is due two lectures later for people who do not yet have CSIL accounts. This means, however, that there will be 2 homeworks due on Wed Oct 1st (one more will be assigned on Monday).
TA will not be holding office hours next Tuesday, Sept 30th. Instead, Nurmi will be holding office hours in his office, Phelps 1409 at 2-2:50pm
TA OFFICE HOURS: Lin's office hours will be on Tuesdays from 200pm - 2:50pm in the CSIL lab
OFFICE HOURS HAVE CHANGED: they are now Monday and Thursday at 2:00pm to 3:00pm in Phelps 1409
Course Description
In this course, we will
be learning (as stated in the title of the course...of course) the C and
C++ programming languages using the UNIX platform as a development environment.
By the end of this course, student will have a solid understanding
of the C and C++ programming languages as well as the UNIX development environment;
tools that are essential for most upper level undergraduate computer science
coursework. To help support a firm understanding of these programming
languages, there will be many small programming assignments for conceptual
units as well as longer programming projects which will enforce combining
programming concepts covered in class.
Administrative Stuff
- syllabus
- academic honesty policy
Helpful Links
SGI STL reference (note that not all functions/containers on this link are included in the linux STL)
OpenGL/glut tutorials for further interest
libSDL portable game programming library
CSIL account management
UNIX tutorial (one hit amonst many by searching google with keywords 'UNIX tutorial')
Sorting Algorithms
Example of execvp() system call (google search "example of execvp")
Example of fork() system call (google search "example of fork function")
Example of pipe() system call (google search "example of pipe function")
Lecture Notes/Worksheets
Note: these notes are meant to suppliment material covered in class, the do not cover complete examples and as such should not be thought of as substitutions for attending class.
Lecture 1
Lecture 2
Lecture 3
Lecture 4
Lecture 5
Lecture 6
Lecture 7
Lecture 8
Lecture 9
Lecture 10
Midterm Review Notes
Lecture 11
Lecture 12
Lecture 13
Lecture 14
Lecture 15
Lecture 16
Lecture 17
Lecture 18
Lecture 19
Lecture 20
Lecture 21
Lecture 22
Lecture 23
Lecture 24
Lecture 25
Final Review
Programming Assignments
Homework 1 Due Wed. Oct 1st. Things you need to know to complete hw1
Homework 2 Due Wed. Oct 1st.
Homework 3 Due Fri. Oct 3rd at 1:00pm.Things you need to know to complete hw3.
hw3numbers.h
hw3numbers_extra.h
Homework 4 Due Mon. Oct 6th at 1:00pm.
Homework 5 Due Wed. Oct 8th at 1:00pm.
hw5.c
hw5data.h
Homework 6 Due Mon. Oct 13th at 1:00pm.
Homework 7 Due Wed. Oct 15th at 1:00pm.
Homework 8 Due Fri. Oct 24th at 1:00pm.
foo.bmp
mc6.bmp
wut.bmp
Homework 9 Due Wed. Oct 29th at 1:00pm.
Homework 10 Due Mod. Nov 3rd at 1:00pm.
complex.h
hw10.c
Homework 11 Due Nov 5th at 1:00pm.
Homework 12 Due Nov 10th at 1:00pm.
Homework 13 Due Nov 12th at 1:00pm.
Homework 14 Due Nov 17th at 1:00pm.
passwd.fake
Homework 15 Due Nov 21st at 1:00pm.
Homework Solutions
hw1.c,
hw1.script
hw2.c,
hw2.script,
hw2_extra.c
hw3.c,
hw3.script,
hw3_extra.c,
hw3_extra.script
hw4.c
hw5.c
hw6.c
hw7.c
hw8.c
hw9.c
hw10.tgz
hw11.tgz
hw12sols.tgz
hw13sols.tgz
hw14sols.tgz
hw15sols.tgz
Projects
Project 1 Due Fri Oct 10th at Midnight.
Project 2 Due Fri Oct 17th at Midnight.
Project 3 Due Fri Oct 31st at Midnight.
Project 4 Due Fri Nov 14th at Midnight.
Basic glut Program Example
sample proj4 binary executable, runs on CSIL machine only!
Project 5 Due Tues Nov 25th at Midnight.
Project 5 update
Project 6 Due Fri Dec 5th at Midnight.
RHAT data
Project 6 sample output
Project 6 addendum
Project Sample Solutions
Project1 Sample Solution
Project1 Extra Credit Sample Solution
Project2 Sample Solutions
Project3 Sample Solution
Project4 Sample Solutions
Project5 Sample Solutions
Grades