#include <iostream>

using namespace std;

void fi(char v[])
{
    for(int i=0; v[i]!=0;i++)
        cout << v[i];
}

void fint(int v[])
{
    for(int i=0; v[i]!=0;i++)
        cout << v[i] << ", " ;
}

void fp(char v[])
{
    for(char* p = v; *p!=0; ++p)
        cout << *p;
}
int main()
{

//    int i = 10;
//    int *pi = &i;
//    cout << "\npi = " << pi << endl;
//    cout << "\n&pi = " << &pi << endl;
//    cout << "\ni == " << i << " == *pi == " << *pi << endl;
//    char c = 'z';
//    char *p = &c;
//    cout << "\nc = " << c << endl;
//    cout << "\n&c = " << &c << endl;
//    cout << "\np = " << p << endl;
//    cout << "\nc == " << c << " == *p == " << *p << endl;
//    double d = 1.235468e5;
//    double *pd = &d;
//    cout << "\nd = " << d << endl;
//    cout << "\n&d = " << &d << endl;
//    cout << "\npd = " << pd << endl;
//    cout << "\nd == " << d << " == *pd == " << *pd << endl;

//    int j = 7;
//    int* pi2 =&j;
//    for(int k = 0; k < 10; k++, ++pi2) {
//       *pi2 = j + k*k;
//       cout << "\nk = " << k << " is at " << &k;
//       cout << "\nMeanwhile, pi2 = " << pi2;
//       cout << "\nwrote " << j+k*k << " to pi2 == " << pi2;
//       cout << "\nk = " << k;
//    }
//    pi2 = &j;
//    for(int k = 0; k < 10; ++k)
//       cout << endl << *pi2++ << " ";

    char* cstr = "afterzero came 1 and then 2 and then three after that four and so on";
    fi(cstr);
    cout << endl;
    int* integer = new int[10];
    integer[0] = 123;
    integer[5] = 0;
    fp(cstr);
    cout << endl;
    fint(integer);
    //cout << "\ncstr = " << cstr;
    //cout << "\nThe memory location of --cstr = " << --cstr;
    return 0;
}
