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).

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

/*You know you need 26 characters, and you need to fill an array. This absolute value lets you utilize a for loop to fill in the individual elements of said array.*/

for (int i=0;i<26;i++)
/*because the i counter will link to a specific array value, it will push into all the array fields (0-25). Then you can define what goes into the array each loop iteration by setting a dynamic character assignment for each value 'A'-'Z' using simple math: i will increase by 1 each time, and you can add that to the char value A' (which is set to an ascii code that increments in values of one)*/

{cp_arr[i]=new char('A'+i);}

When the program runs it loops like this:
i=0, cp_arr[0]= 'A'+0
i=1, cp_arr[1]= 'B' //'A'+1
.... and so on until
i=25, cp_arr[25]='Z' //'A'+25

I know this question is old but it might help future students understand some simpler coding.

I do not understand how your code could have worked in VC++. Perhaps you don't have the right version.

Anyway, many of the repetitive initialization could have been simplified.

Here's an example code that works in Dev C++. See if this can inspire what you want to to.

#include <iostream>
using namespace std;

int main(int argc, char *argv[]){
char alphabet[]={'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'};
char *arr1=alphabet; // pointer to beginning of char array
char *cp_arr[26]; // array of 26 char pointers
int i;
for(i = 0; i < 26; i++)cout << *(arr1+i); // print 26 characters using pointer arr1
cout << endl;
for(i=0;i<26;i++)cp_arr[i]=arr1+i; // assign 26 pointers to array
for(int i = 0; i < 26; i++)cout << *cp_arr[i]; // print 26 char. from pointer array
cout << endl;
system("PAUSE");
}

those are 2 different codes above, I wrote them that way because what you wrote was similar to what I had before but myprogramminglab does not like it. Still does not like it. thank you though I think i give up, at least on this one.

We are not able work in Myprogramminglab, so we don't get to see the exact instructions and the error message to help.

It is possible that these labs require a very precise way to present your answer/program, so it does not "work" when it can actually compile elsewhere.

One way to find out further is to provide (multiple) screen shots on the requirements (instructions) and the answer, together with (very important) the error message. Perhaps we can get somewhere with it. You can (most of the time) post links to Imageshack or other file servers for the screen shots.

ty

The code snippet you provided has a few issues. Let's go through it and make the necessary corrections.

1. Declare the cp_arr array as an array of 26 pointers to char:
```
char* cp_arr[26]; // Array of 26 pointers to char
```

2. Allocate memory for each character value and assign their pointers to cp_arr:
```
for(int i = 0; i < 26; i++) {
cp_arr[i] = new char('A' + i); // Allocate memory for characters 'A' to 'Z'
}
```

3. Print the elements of cp_arr:
```
for(int i = 0; i < 26; i++) {
cout << *(cp_arr[i]); // Dereference the pointer and print the character
}
cout << endl; // Print a new line
```

This code will correctly allocate memory for characters 'A' through 'Z' and assign their pointers to the elements of cp_arr. It will then print the characters using the dereferenced pointers.

Remember to deallocate the memory allocated using the `new` operator after you are done using it to avoid memory leaks:
```
for(int i = 0; i < 26; i++) {
delete cp_arr[i]; // Deallocate the memory
}
```

I hope this explanation helps you understand the corrections made to the code. Let me know if you have any further questions!