| VMS | VAX systems |
| Unix | Open system; variates include Gnu, Linux, Sun/Solaris |
| MS-DOS | Intel/Microsoft |
| Macintosh | PPC (IBM and Motorola)/Apple |
| Windows95 | Intel/Microsoft |
| Windows/NT | Intel/Microsoft |
| Rhapsody | Intel and PPC/Apple & NeXT |
| Time | Events | Procedural | Structured | Object-Oriented |
| 1950 | early mainframe | assembly | ||
| 1955 | FORTRAN, COBOL | |||
| 1960 | ALGOL | |||
| 1965 | network computing | BASIC | LISP (sort of) | |
| 1970 | PL/1 | Pascal | ||
| 1975 | minicomputer; Unix | C | ||
| 1980 | personal computer | Ada | ||
| 1985 | Macintosh GUI | Object Pascal; C++ | ||
| 1990 | Visual Basic | |||
| 1995 | WWW | perl | Java |
1. ANSI C will run on virtually any machine with no modifications
2. The syntax is similar to that used in C++ and Java
3. It is a structured language with the standard set of control structures
4. Until recently, C was the most common language for applications development
5. It produces very fast code
1. It has a very rich set of functions and operators, most of which you can safely ignore;
2. Many of these functions are very idiosyncratic;
3. It does not provide array bounds checking; instead it crashes the operating system;
4. There are usually multiple ways to do anything in C, and the most efficient code is frequently the most obscure.
| Tool | Tasks |
| Paper | 1. Define the program objectives 2. Figure out the appropriate algorithms |
| Text editor | Write the program |
| Compiler | 1. Check the syntax 2. Convert the program to assembly language |
| Linker | Add the appropriate libraries |
| Run | Run the program in the operating system |
These combine an editor, compiler/ linker and a debugger into a single system. Files are usually organized into "projects" that keep relevant information together.
| ANSI | American National Standards Institute |
| ASCII | American Standard Code for Information Interchange |
| byte | 8 bits of memory (=one character) |
| Mb | megabyteÑroughly 1-million bytes |
| RAM | random access memory |
| // | initial documentation |
| #include | include library headers (preprocessor) |
| #define | define global constants (preprocessor) |
| int n char aline[14] | allocate global memory |
| void main(void) | main function |
| int funct1(int n) float funct2(int n) void funct3(void) | remaining functions |
== equal [Warning: this is the single greatest source of C bugs!!]
!= Not equal
<, > less than, greater than
<=,>= less than or equal, greater than or equal
! not
&& and
|| or
printf(format string, variable list);
fprintf(file ptr, format string, variable list);
| %d | output an integer |
| %f | output a floating point number |
| %c | output a character |
| %s | output a string |
| %8d | output right-justified 8-digit integer |
| %5.2f | output 2 digits to right of decimal; 5 characters total (including the .) |
| %10s | output a string of at least 10 chars |
| %5.5s | output a string of exactly 10 chars |
| \t | tab |
| \n | new line |
| \" | double-quote |
| \' | single-quote |
| %% | % "percent sign" |
| \\ | \"backslash" |
int n
n = n + 1; (similar to BASIC, Pascal)
n += 1;
n++; (get value, then increment)
++n; (increment, then get value)