Hi

Please don't mind my asking the following question(s).

I was under the impression that the character arrays work as regular arrays such as of type int, float etc. I was thinking that one can put more than one digit (e.g. 12, 13, etc.) or more than one letter (such as ab, bb, ccc, etc.).

Please have a look on this ASCII table.

The character values given for decimal values from "0" to "32" consist of more than one character. For example, for decimal value "0" the character value given is "NUL", and for decimal value "9" we have character value "TAB".

I was wrong. An array element of character type can contain only one digit or character. The character values which consist of more than character such as "NUL" or "TAB" stand for particular function or signs. For example, "TAB" is a set of white spaces, and "Space" (decimal value is 32) is single white space.

Please correct me if I'm wrong without confusing me more!

Code:
// learning_character_strings.cpp
// learning how character string work

#include <iostream>
#include <cstdlib>
#include <cstring>

using namespace std;

int main()
{
        int i;
        const int C = 5;

        char string[C];

        for (i=0; i<C; i++)
        {
                cout << "enter string #" << (i+1) << ": ";
                cin >> string[i];
        }

        cout << "\n\n";

        for (i=0; i<C; i++)
        {

                cout << "string #" << (i+1) << " is: " << string[i] << endl;
        }

        system("pause");
        return 0;

}