Hi, im pretty new to c++, and im stuck on this problem, i need to assign a letter from and array of stings to an array of chars and i just cannot figure it out.
any help is appreciated.
I tried both and both give me errors:
strcpy (newChars[j],alphabet[i]);
newChars[j]=alphabet[i];
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
char* newChars = new char[100];
string alphabet[52] = { "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","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"};
int i=0;
for (int j=0;j<52;j++){
cout << j << "======" << alphabet[j]<<"\n"<< endl;
//std::strcpy (newChars[j],alphabet[i]);
newChars[j]=alphabet[i];
}
}