CSC161 2011S Imperative Problem Solving
[Skip to Body]
Primary:
[Front Door]
[Schedule]
[Piazzza]
-
[Academic Honesty]
[Instructions]
Current:
[Current Outline]
[Current EBoard]
-
[Current Assignment]
[Current Lab]
[Current Reading]
Groupings:
[Assignments]
[Documents]
[EBoards]
[Examples]
[Exams]
[Handouts]
[Labs]
[Outlines]
[Readings]
[Reference]
Related Courses:
[CSC195 2003S (Rebelsky)]
[CSC161 2009F (Coahran)]
[CSC161 2010S (Walker)]
[CSC161 2010F (Rebelsky)]
Misc:
[SamR]
[ISO]
[GNU Coding Standards]
Back to Files. On to Linked Lists (1).
This outline is also available in PDF.
Held: Wednesday, 20 April 2011
Summary: We consider structured types in C.
Related Pages:
Notes:
Overview:
records) in some languages, group heterogeneously and index by name.
struct NAME
{
TYPE_0 FIELDNAME_0;
TYPE_1 FIELDNAME_1;
TYPE_2 FIELDNAME_2;
...
};
struct student
{
char *name;
char *id;
double gpa;
int debt; // In cents
int grades[64];
}
struct NAME VAR;
struct student jordan;
Accessa field
printf ("Jordan owes approxmately $%d\n", jordan.debt/100);
jordan.debt *= 1.05; // Interest is a bear
TYPE.
typedef in front.
int grade; char *string; int (*strcomparator)(char *, char*); struct student someone;
typedef int grade; typedef char *string; typedef int (*strcomparator)(char *, char*); typedef struct student someone;
grade hw1; string name; strcomparator comp = strcmp; someone jordan;
typedef TYPE int; void sort (TYPE values[], int size, int compare(TYPE v0, TYPE v1));
Back to Files. On to Linked Lists (1).
[Skip to Body]
Primary:
[Front Door]
[Schedule]
[Piazzza]
-
[Academic Honesty]
[Instructions]
Current:
[Current Outline]
[Current EBoard]
-
[Current Assignment]
[Current Lab]
[Current Reading]
Groupings:
[Assignments]
[Documents]
[EBoards]
[Examples]
[Exams]
[Handouts]
[Labs]
[Outlines]
[Readings]
[Reference]
Related Courses:
[CSC195 2003S (Rebelsky)]
[CSC161 2009F (Coahran)]
[CSC161 2010S (Walker)]
[CSC161 2010F (Rebelsky)]
Misc:
[SamR]
[ISO]
[GNU Coding Standards]
Disclaimer:
I usually create these pages on the fly
, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Tue May 10 10:34:35 2011.
The source to the document was last modified on Wed Jan 5 12:52:14 2011.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CSC161/2011S/Outlines/outline.43.html.