CS 241 Section Week #1: January 26, 2011
CS 241 Section Week #1: January 26, 2011
Section Week #1
January 26, 2011
Topics This Section
• HW #1
• C Code Examples
2
Piazza
Work as a team (staff and students) to offer help
3
Homework #1
• Easy?
4
Homework #1
• void Problem15(){
int x;
...
if(x < 0){
printf("invalid value.\n");
exit;
}
}
5
Homework #1
• void Problem15(){
int x;
...
if(x < 0){
printf("invalid value.\n");
exit;
}
}
6
Homework #1
• Problem #19
long int clear_bit(long int value, long int flag){
7
Homework #1
• Problem #20
long int is_equal(long int x, long int y){
8
svn
• Each week, there will be files we provide for
us to use in section.
9
svn
• To create a local “working copy” of the SVN,
you need to run an svn checkoout command:
10
svn
• Make sure your checkout worked:
$ cd cs241
$ ls
ds hw1
$ cd ds
$ ls
ds1
$ cd ds1
$ ls
1.c 2.c 3.c 4.c 5.c
11
svn
• You only need to checkout files once!
12
svn
• When you’ve got something working, you will
want to commit the changes you made back
to the server with an svn commit:
svn ci -m ""
svn commit -m "some message"
13
svn
• When you’ve got something working, you will
want to commit the changes you made back
to the server with an svn commit:
svn ci -m ""
svn commit -m "some message"
15
svn
• Lets add a file, and verify we added it:
(You should probably be in your ds1 directory for this.)
16
svn
• What time did you make the submission? Did
you make it in on time?
------------------------------------------------------------------------
r3866 | netid | 2011-22-08 22:07:59 -0600 (Mon, 22 Aug 2011) | 1 line
17
svn
• Oh no! Your latest changes breaks everything!
18
Discussion Section Practice
• Five different files, each having code snippets
similar to HW1.
• In your svn: ds/ds1/
• 1.c, 2.c, 3.c, 4.c, 5.c
19