How can I copy a multidimensional array? [modified]
C / C++ / MFC
2
Posts
1
Posters
0
Views
1
Watching
-
Hello All, How can I copy a multidimensional array? For example an array such as this one:
CListViewCell (\*m\_pCell)\[50\] = new CListViewCell\[cpy.m\_nRows\]\[50\];
Sorry it's been years, but I don't think this will work:
memcpy(m\_pCell, cpy.m\_pCell, sizeof(cpy.m\_pCell));
The code is in an assignment function (operator=) of a class. Values have been changed to keep it simple. Any help would be appreciated! Paul
modified on Thursday, September 24, 2009 9:47 PM
-
Hello All, How can I copy a multidimensional array? For example an array such as this one:
CListViewCell (\*m\_pCell)\[50\] = new CListViewCell\[cpy.m\_nRows\]\[50\];
Sorry it's been years, but I don't think this will work:
memcpy(m\_pCell, cpy.m\_pCell, sizeof(cpy.m\_pCell));
The code is in an assignment function (operator=) of a class. Values have been changed to keep it simple. Any help would be appreciated! Paul
modified on Thursday, September 24, 2009 9:47 PM
Thanks anyway.