[FrontPage] [TitleIndex] [WordIndex

Note: You are looking at a static copy of the former PineWiki site, used for class notes by James Aspnes from 2003 to 2012. Many mathematical formulas are broken, and there are likely to be other bugs as well. These will most likely not be fixed. You may be able to find more up-to-date versions of some of these notes at http://www.cs.yale.edu/homes/aspnes/#classes.

C99 is the most recent standard dialect of C. It replaces ANSI C (also known as C90), the dialect described in KernighanRitchie. By standard it is meant that there exist a standards document describing the language. Sadly, this does not mean that all or even many compilers support all features of C99.

For CS223, you may use the features of C99 that are supported by gcc. To access these features, gcc should be run with the -std=c99 flag. If you would prefer to avoid using these features, that's OK too.

Some features of C99 that are actually useful:

   1     // if we got here, we are in trouble
   2     destroy_evidence();

   1     // note: i is defined only inside the loop
   2     // (this is usually a good thing)
   3     for(int i = 0; i < n; i++) {
   4         a[i] = 0;
   5     }

Features whose utility is less obvious:


CategoryProgrammingNotes


2014-06-17 11:57