/*
* hello.c (assignment 0, cs137)
* by Clive Chan (cc@clive.io), UW SE 2021
* Works with gcc 4.9.3, using -std=c99
*/
#if?/
def for
?=define \
very long
very long */\
/?!?/
very very long /\
*very very very very long /*\
struct i cfw_
I,i=0,c=3,n=4,b=2,l
Programming
Lecture
3
S eptember 20, 2012
Operators
Relational
o < less than
o > greater than
o <= less than or equal to
o >= greater than or equal to
Equality
o = equals
o != not equals
Logical
o ! not
o | or
Short-circuits evaluation (evaluates left
Programming
Lecture
7
O ctober 4, 2012
More Arrays
As arguments, memory address of start of array is passed
Example:
o void one23 (int a[], int n)
cfw_
for (int i=0; i<n; i+)
a[i]=i+1;
int main ()
cfw_
int a[1000];
one23(a,1000);
printf(0\n, a[2]);
re
Ninja
Mutant
Programming
Lecture
17
N ovember 15, 2012
Big O Notation
Let f(x) be a function over real numbers
O(f(x) is a set of functions
g(x) O(f(x) if and only if there exists M>0 and x0 such that |g(x0| M|f(x)| for all x>x0
Eg:
o 3x2 + 2 O(x