Post a New Question

computer science

posted by .

The variable cp_arr has been declared as an array of 26 pointers to char. Allocate 26 character values, initialized to the letters 'A' through 'Z' and assign their pointers to the elements of cp_arr (in that order).

  • computer science -

    Can you post your code and explain the difficulties you encounter?

  • computer science -

    lol I've had so many codes for this problem.

    int *arr1[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
    arr1=cp_arr[0];
    for(int i = 0; i < 26; i++)
    cout << cp_arr[i];
    is the newest,
    char a ='A', b = 'B', c = 'C', d='D', e='E', f='F', g='G', h='H', i='I', j='J', k='K',l='L', m='M', n='N', o='O', p='P', q='Q', r='R', s='S', t='T', u='U', v='V', w='W', x = 'X', y='Y', z='Z';
    cp_arr[0] = a;
    cp_arr[1] = b;
    cp_arr[2] = c;
    cp_arr[3] = d;
    cp_arr[4] = e;
    cp_arr[5] = f;
    cp_arr[6] = g;
    cp_arr[7] = h;
    cp_arr[8] = i;
    cp_arr[9] = j;
    cp_arr[10] = k;
    cp_arr[11] = l;
    cp_arr[12] = m;
    cp_arr[13] = n;
    cp_arr[14] = o;
    cp_arr[15] = p;
    cp_arr[16] = q;
    cp_arr[17] = r;
    cp_arr[18] = s;
    cp_arr[19] = t;
    cp_arr[20] = u;
    cp_arr[21] = v;
    cp_arr[22] = w;
    cp_arr[23] = x;
    cp_arr[24] = y;
    cp_arr[25] = z;

    for(int i = 0; i < 26; i++)
    cout << cp_arr[i];
    cout << endl;
    both worked in visual but not myprogramming lab there has to be a better code for this but these were the only ones that worked

Answer This Question

First Name:
School Subject:
Answer:

Related Questions

More Related Questions

Post a New Question