Return to Topic Menu | Computer Science Main Page | MathBits.com | Terms of Use

the APSTRING class

From the College Board for Advanced Placement Computer Science

 

Remember:  A string is a sequence of multiple characters, such as words, sentences, or addresses.  They are referred to as alphanumerics (alphabet characters and/or numbers).

As we have already discovered, there is no built-in string data type in standard C++.  We created "strings" by using an array of characters, such as

char name[ ] = "Alexis";

A l e x i s \0

0

1 2 3 4 5 6

We quickly discovered that these "strings" were difficult to manipulate - such as the difficulties associated with assigning new values.

The College Board has allowed for the inclusion of the APSTRING class to allow for easier manipulation of "strings".  There are two necessary components to using the APSTRING class:

"apstring.h" - library (commented) header file for new manipulation functions
"apstring.cpp" - implementation header file.  It uses #include <string.h>, #include <assert.h>, and #include "apstring.h"

 

Return to Topic Menu | Computer Science Main Page | MathBits.com | Terms of Use