KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
in C++ I want to initialize a double matrix (2-dimensional double array) like I would normally do without pointers like so: double data[4][4] = { 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 }; However, since I want to return and pass it to functions, I need it as a double** pointer. So, basically I need to initialize data in a nice way (as above), but then afterwards I need to save the pointer to the 2D-array without losing the data when the function exits. Any help on this? :-)
Tags (comma-separated)
Save Edits
Cancel