/* This program demonstrates * 1. Writing functions that work with c-strings * 2. Using the query an conversion functions in the cctype library. * 3. Copying strings: strcpy * 4. Concatenating Strings: strcat * * The cctype library contains a variety of functions that answer questions about individual characters. * They can be used in conjunction with c-strings to et some statistics about the string. * * c-strings are still arrays. The need to be deep-copied. * * We also implement strcpy ourselves, to understand how it works */ #include #include // for query functions #include // for string length using namespace std; //function declarations int sentenceCount(char st[]); int numeralCount(char st[]); void convert(char st[]); int main() { //Declare a C-string and read it in char str[200]; cin.getline(str, 100, '#'); //read until # char c; cin>>c; // read in a single character /* We can print the length of a string using the strlen function fromt he cstring library */ cout<<"Length of st is "<< strlen(st)<