CSC161 2011S Imperative Problem Solving

Class 35: Strings

Back to Make, Revisited. On to Strings, Continued.

This outline is also available in PDF.

Held: Wednesday, 6 April 2011

Summary: We begin to consider the design of strings in C.

Related Pages:

Notes:

Overview:

Strings

Important String Functions

Thinking Like a C Programmer

While I've put strcpy in the outline, a reading question suggests that I should do strcmp instead.

/**
 * strcpy: Copy source (s) to target (t).
 */
void 
strcpy (char *t, char *s) 
{
  char *result = t;
  while (*t++ = *s++)
    ;
  return result;
} // strcpy

Lab

Back to Make, Revisited. On to Strings, Continued.

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:33 2011.
The source to the document was last modified on Wed Jan 5 12:52:12 2011.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CSC161/2011S/Outlines/outline.35.html.

Samuel A. Rebelsky, rebelsky@grinnell.edu