comp26120: algorithms and imperative...
TRANSCRIPT
![Page 1: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/1.jpg)
COMP26120: Algorithms and ImperativeProgrammingLecture C5: C - You Asked For It, You Got It
Pete Jinks
School of Computer Science, University of Manchester
Autumn 2010
COMP26120 Lecture C5 1/34
![Page 2: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/2.jpg)
Lewis Carroll – The Hunting of the Snark (an Agony, inEight Fits)
Fit the First – The Landing.
”Just the place for a Snark!” the Bellman cried,As he landed his crew with care;Supporting each man on the top of the tideBy a finger entwined in his hair.
”Just the place for a Snark! I have said it twice:That alone should encourage the crew.Just the place for a Snark! I have said it thrice:What I tell you three times is true.”
COMP26120 Lecture C5 3/34
![Page 3: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/3.jpg)
C.A.R.Hoare – 1980 ACM Turing Award Lecture.
”I was eventually persuaded of the need to designprogramming notations so as to maximise the number of errorswhich cannot be made, or if made, can be reliably detected atcompile time.
Perhaps this would make the text of programs longer. Nevermind!
Wouldn’t you be delighted if your Fairy Godmother offered towave her wand over your program to remove all its errors andonly made the condition that you shouldwrite out and key in your whole program three times!”
COMP26120 Lecture C5 5/34
![Page 4: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/4.jpg)
Review
?
COMP26120 Lecture C5 6/34
![Page 5: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/5.jpg)
Lecture Outline
Language Design Philosophy
YAFIYGI
COMP26120 Lecture C5 7/34
![Page 6: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/6.jpg)
Lecture C5: You are here
Language Design Philosophy
YAFIYGI
COMP26120 Lecture C5 Language Design Philosophy 8/34
![Page 7: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/7.jpg)
Design Goals of Java
The Java Language Environment – May 1996
Simple, Object Oriented, and FamiliarRobust and SecureArchitecture Neutral and PortableHigh PerformanceInterpreted, Threaded, and Dynamic
Extensive compile-time + run-time checkingStrong typing – mainly StaticEliminate dangerous language features:
automatic coercions, pointers, gotos, . . .and redundant language features:
typedef, struct, union, . . .
“Sacrifice code speed to get coding speed”
COMP26120 Lecture C5 Language Design Philosophy 10/34
![Page 8: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/8.jpg)
Design Goals of Java
The Java Language Environment – May 1996
Simple, Object Oriented, and FamiliarRobust and SecureArchitecture Neutral and PortableHigh PerformanceInterpreted, Threaded, and Dynamic
Extensive compile-time + run-time checkingStrong typing – mainly StaticEliminate dangerous language features:
automatic coercions, pointers, gotos, . . .and redundant language features:
typedef, struct, union, . . .
“Sacrifice code speed to get coding speed”
COMP26120 Lecture C5 Language Design Philosophy 10/34
![Page 9: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/9.jpg)
Design Goals of Java
The Java Language Environment – May 1996
Simple, Object Oriented, and FamiliarRobust and SecureArchitecture Neutral and PortableHigh PerformanceInterpreted, Threaded, and Dynamic
Extensive compile-time + run-time checkingStrong typing – mainly StaticEliminate dangerous language features:
automatic coercions, pointers, gotos, . . .and redundant language features:
typedef, struct, union, . . .
“Sacrifice code speed to get coding speed”
COMP26120 Lecture C5 Language Design Philosophy 10/34
![Page 10: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/10.jpg)
C
A low-level language for small computerse.g. operating systems, embedded systems
“Don’t hide the hardware”
Speed, Efficiency >> Safety
A small language
The programmer is knowledgeable; trust the programmer.
Strengths: Efficiency, Power, Flexibility, Standard Library, Unix
Weaknesses: Error-prone, Difficult to understand
COMP26120 Lecture C5 Language Design Philosophy 12/34
![Page 11: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/11.jpg)
C
A low-level language for small computerse.g. operating systems, embedded systems
“Don’t hide the hardware”
Speed, Efficiency >> Safety
A small language
The programmer is knowledgeable; trust the programmer.
Strengths: Efficiency, Power, Flexibility, Standard Library, Unix
Weaknesses: Error-prone, Difficult to understand
COMP26120 Lecture C5 Language Design Philosophy 12/34
![Page 12: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/12.jpg)
C
A low-level language for small computerse.g. operating systems, embedded systems
“Don’t hide the hardware”
Speed, Efficiency >> Safety
A small language
The programmer is knowledgeable; trust the programmer.
Strengths: Efficiency, Power, Flexibility, Standard Library, Unix
Weaknesses: Error-prone, Difficult to understand
COMP26120 Lecture C5 Language Design Philosophy 12/34
![Page 13: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/13.jpg)
C Portability
Unportable:– undefined (incorrect and no default behaviour)
e.g. int overflow– implementation-defined (correct but compiler-dependant)
e.g. int >>– unspecified (correct but no default behaviour)
e.g. argument evaluation order
Portable:– conforming (always get sensible answers)
e.g. limits.h defines INT MAX etc.– strictly-conforming (always get same answers)
e.g. stdint.h defines int32 t INT32 MAX etc.
COMP26120 Lecture C5 Language Design Philosophy 14/34
![Page 14: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/14.jpg)
C Portability
Unportable:– undefined (incorrect and no default behaviour)
e.g. int overflow– implementation-defined (correct but compiler-dependant)
e.g. int >>– unspecified (correct but no default behaviour)
e.g. argument evaluation order
Portable:– conforming (always get sensible answers)
e.g. limits.h defines INT MAX etc.– strictly-conforming (always get same answers)
e.g. stdint.h defines int32 t INT32 MAX etc.
COMP26120 Lecture C5 Language Design Philosophy 14/34
![Page 15: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/15.jpg)
Lecture C5: You are here
Language Design Philosophy
YAFIYGI
COMP26120 Lecture C5 YAFIYGI 15/34
![Page 16: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/16.jpg)
Weak Typing
union oops {int a; float b; void * c;};
(struct person*) malloc (...)
Implicit Coercion; Explicit Cast
Change bits; Change type but not bits
COMP26120 Lecture C5 YAFIYGI 17/34
![Page 17: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/17.jpg)
Weak Typing
union oops {int a; float b; void * c;};
(struct person*) malloc (...)
Implicit Coercion; Explicit Cast
Change bits; Change type but not bits
COMP26120 Lecture C5 YAFIYGI 17/34
![Page 18: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/18.jpg)
Weak Typing
union oops {int a; float b; void * c;};
(struct person*) malloc (...)
Implicit Coercion; Explicit Cast
Change bits; Change type but not bits
COMP26120 Lecture C5 YAFIYGI 17/34
![Page 19: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/19.jpg)
to break or not to break
switch(x) {default:if (prime(x))
case 2: case 3: case 5: case 7:process prime(x);
elsecase 4: case 6: case 8: case 9: case 10:
process non prime(x);}
COMP26120 Lecture C5 YAFIYGI 19/34
![Page 20: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/20.jpg)
to break or not to break
switch(x) {default:if (prime(x))
case 2: case 3: case 5: case 7:process prime(x);
elsecase 4: case 6: case 8: case 9: case 10:
process non prime(x);}
COMP26120 Lecture C5 YAFIYGI 19/34
![Page 21: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/21.jpg)
to break or not to break
switch(x) {default:if (prime(x))
case 2: case 3: case 5: case 7:process prime(x);
elsecase 4: case 6: case 8: case 9: case 10:
process non prime(x);}
COMP26120 Lecture C5 YAFIYGI 19/34
![Page 22: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/22.jpg)
to break or not to break
switch(x) {default:if (prime(x))
case 2: case 3: case 5: case 7:process prime(x);
elsecase 4: case 6: case 8: case 9: case 10:
process non prime(x);}
COMP26120 Lecture C5 YAFIYGI 19/34
![Page 23: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/23.jpg)
, is an operator
for (i=0, j=2; i<j; i+=2, j++)...
a, b= b, a; // swap a and b
COMP26120 Lecture C5 YAFIYGI 21/34
![Page 24: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/24.jpg)
, is an operator
for (i=0, j=2; i<j; i+=2, j++)...
a, b= b, a; // swap a and b
COMP26120 Lecture C5 YAFIYGI 21/34
![Page 25: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/25.jpg)
= is an operator
e.g. char *s, *t;
while (*s++);
while (*s++ == *t++);
while (*s++ = *t++);
COMP26120 Lecture C5 YAFIYGI 23/34
![Page 26: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/26.jpg)
= is an operator
e.g. char *s, *t;
while (*s++);
while (*s++ == *t++);
while (*s++ = *t++);
COMP26120 Lecture C5 YAFIYGI 23/34
![Page 27: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/27.jpg)
= is an operator
e.g. char *s, *t;
while (*s++);
while (*s++ == *t++);
while (*s++ = *t++);
COMP26120 Lecture C5 YAFIYGI 23/34
![Page 28: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/28.jpg)
boolean?
int min=0, max=100, x;. . .min <= x <= max
COMP26120 Lecture C5 YAFIYGI 25/34
![Page 29: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/29.jpg)
char?
’A’
getchar()
COMP26120 Lecture C5 YAFIYGI 27/34
![Page 30: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/30.jpg)
Operator overloading
(b) - (c);
(b) + (c);
(b) * (c);
(b) & (c);
(b) (c);
COMP26120 Lecture C5 YAFIYGI 29/34
![Page 31: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/31.jpg)
Operator overloading
(b) - (c);
(b) + (c);
(b) * (c);
(b) & (c);
(b) (c);
COMP26120 Lecture C5 YAFIYGI 29/34
![Page 32: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/32.jpg)
Operator overloading
(b) - (c);
(b) + (c);
(b) * (c);
(b) & (c);
(b) (c);
COMP26120 Lecture C5 YAFIYGI 29/34
![Page 33: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/33.jpg)
Operator overloading
(b) - (c);
(b) + (c);
(b) * (c);
(b) & (c);
(b) (c);
COMP26120 Lecture C5 YAFIYGI 29/34
![Page 34: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/34.jpg)
White space
a+++++b;
char *s[]= {"A", "B", "C" "D", "E",};
COMP26120 Lecture C5 YAFIYGI 31/34
![Page 35: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/35.jpg)
White space
a+++++b;
char *s[]= {"A", "B", "C" "D", "E",};
COMP26120 Lecture C5 YAFIYGI 31/34
![Page 36: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/36.jpg)
Synonyms – “Syntactic Sugar”
a=a+1; a+=1; a++; ++a;
(*a).b; a->b;
a[3]; *(a+3); *(3+a); 3[a];
for (A; B; C) {D;
}
A;while(B) {D; C;
}
COMP26120 Lecture C5 YAFIYGI 33/34
![Page 37: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/37.jpg)
Synonyms – “Syntactic Sugar”
a=a+1; a+=1; a++; ++a;
(*a).b; a->b;
a[3]; *(a+3); *(3+a); 3[a];
for (A; B; C) {D;
}
A;while(B) {D; C;
}
COMP26120 Lecture C5 YAFIYGI 33/34
![Page 38: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/38.jpg)
Synonyms – “Syntactic Sugar”
a=a+1; a+=1; a++; ++a;
(*a).b; a->b;
a[3]; *(a+3); *(3+a); 3[a];
for (A; B; C) {D;
}
A;while(B) {D; C;
}
COMP26120 Lecture C5 YAFIYGI 33/34
![Page 39: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/39.jpg)
Synonyms – “Syntactic Sugar”
a=a+1; a+=1; a++; ++a;
(*a).b; a->b;
a[3]; *(a+3); *(3+a); 3[a];
for (A; B; C) {D;
}
A;while(B) {D; C;
}
COMP26120 Lecture C5 YAFIYGI 33/34
![Page 40: COMP26120: Algorithms and Imperative Programmingsyllabus.cs.manchester.ac.uk/ugt/2017/COMP26120/lecture/pjjhando… · Programming Lecture C5: C - You Asked For It, You Got It Pete](https://reader033.vdocuments.us/reader033/viewer/2022050116/5f4d57d1dd135003dc39d5b8/html5/thumbnails/40.jpg)
Lecture Review
Language Design Philosophy
YAFIYGI
COMP26120 Lecture C5 YAFIYGI 34/34