the c programming language
DESCRIPTION
A presentation I gave with a classmate on the C programming language. We covered the history and reasons development as well as some of the language specifics. This was for a Belmont Programming Languages class.TRANSCRIPT
![Page 1: The C Programming Language](https://reader031.vdocument.in/reader031/viewer/2022020110/549a326cb4795952338b49ad/html5/thumbnails/1.jpg)
The C Programming LanguageBryn Bodayle & Grant Yentzer
![Page 2: The C Programming Language](https://reader031.vdocument.in/reader031/viewer/2022020110/549a326cb4795952338b49ad/html5/thumbnails/2.jpg)
History of C
1972 at Bell Laboratories
Prior to B, BCPL, and FORTRAN
Unison with UNIX operating system
Finished in 1973
The C Programming Language
![Page 3: The C Programming Language](https://reader031.vdocument.in/reader031/viewer/2022020110/549a326cb4795952338b49ad/html5/thumbnails/3.jpg)
That which comes after B
C
![Page 4: The C Programming Language](https://reader031.vdocument.in/reader031/viewer/2022020110/549a326cb4795952338b49ad/html5/thumbnails/4.jpg)
Advantages at the Time
Similar syntax to B
Additions of structures and data-types
Block structure, easily understandable
Allows fine control of assembly language, access individual bits of information
Portability allowing for reuse of libraries
![Page 5: The C Programming Language](https://reader031.vdocument.in/reader031/viewer/2022020110/549a326cb4795952338b49ad/html5/thumbnails/5.jpg)
Advantages Today
TIOBE ranked as most popular language above Java & Objective-C
Basis for other languages: transferable to other languages
Standardization and continued development
Understand lower level mechanics i.e, arrays
![Page 6: The C Programming Language](https://reader031.vdocument.in/reader031/viewer/2022020110/549a326cb4795952338b49ad/html5/thumbnails/6.jpg)
int c = 4;
int y = 0; char value; if(c > 3) { y = c; value = 'A'; } else { c = y; c++; value = 'B'; } return value;
What language is this?
![Page 7: The C Programming Language](https://reader031.vdocument.in/reader031/viewer/2022020110/549a326cb4795952338b49ad/html5/thumbnails/7.jpg)
C, C++, C#, Java Objective-c
![Page 8: The C Programming Language](https://reader031.vdocument.in/reader031/viewer/2022020110/549a326cb4795952338b49ad/html5/thumbnails/8.jpg)
Assignment Gotchas
Order of functions matter
Pointers and arrays can be confusing
printf("always specifying a line break is annoying \n");
Static scope, static typing, no scope resolution operator, no overloading, no exception handling
Left to right function argument evaluation, short circuit evaluation, unions and structs
![Page 9: The C Programming Language](https://reader031.vdocument.in/reader031/viewer/2022020110/549a326cb4795952338b49ad/html5/thumbnails/9.jpg)
Dangling Else int x = 1; if(x != 4) if(x == 3) printf("not reached"); else printf("dangling else reached because the else is automatically attached to the innermost if statement \n");
![Page 10: The C Programming Language](https://reader031.vdocument.in/reader031/viewer/2022020110/549a326cb4795952338b49ad/html5/thumbnails/10.jpg)
Unionsunion UnionThing{ int i; char c;};
...
union UnionThing unionThing; unionThing.i = 30; unionThing.c = 'A'; //prints out the value stored in the struct printf("%c \n", unionThing.c); // output is "A" //only one value can be stored in a union at a time, so i is not 30, it is 65 which is A printf("%i \n", unionThing.i); // output is "65"
![Page 11: The C Programming Language](https://reader031.vdocument.in/reader031/viewer/2022020110/549a326cb4795952338b49ad/html5/thumbnails/11.jpg)
Why we chose C?
![Page 12: The C Programming Language](https://reader031.vdocument.in/reader031/viewer/2022020110/549a326cb4795952338b49ad/html5/thumbnails/12.jpg)