Hello Everyone so i am trying to copy the contents of a list into a char array but i get an access memory violation error when using memcpy, my code i use is below:
[code]
int currIteration = 0;
char ** pwdAry;
pwdAry = new char *[numberOfPwd];
for (int a = 0; a < 4; a++) {
pwdAry[a] = new char[1024];
}
for (int i = 0; i < List.size(); i++)
{
string tmp = List.front();
char * val;
val = new char[1024];
const char* cstr;
Ah, I've just noticed that I have the size of the 2nd dimension of the char array only set to size of 4 not the size of the list :)
[code]
int currIteration = 0;
char ** pwdAry;
pwdAry = new char *[numberOfPwd];
for (int a = 0; a < List.size(); a++) {
pwdAry[a] = new char[1024];
}
for (int i = 0; i < List.size(); i++)
{
string tmp = List.front();
char * val;
val = new char[1024];
const char* cstr;