CSC161 2010F Imperative Problem Solving

Class 34: Strings

Back to Pointers and Arrays. On to Pause for Breath.

This outline is also available in PDF.

Held: Monday, 1 November 2010

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

Related Pages:

Notes:

Overview:

Strings

Important String Functions

Thinking Like a C Programmer

/**
 * 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 Pointers and Arrays. On to Pause for Breath.

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 Wed Dec 8 10:57:11 2010.
The source to the document was last modified on Fri Aug 27 07:12:23 2010.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CSC161/2010F/Outlines/outline.34.html.

Samuel A. Rebelsky, rebelsky@grinnell.edu