According to this site, I should be able to use the following code:
double luggage [3] [3]; Double ** p_stuff; P_stuff = Accessories; But I get a complaint that conversion is not allowed by assignment.
Am I doing something wrong?
C is the type of function that I want to pass through this double stuff [3] [3] then I think I need to make it an indicator, okay?
About editing: code> double content [3] [3] for C function, you
1) You can pass a pointer in the entire 2D array:
zero doostf (double (* a) [3] [3]) {// access them (* A) [0] [0] .. (* A) [2] [2]} int main () {double content [3] [3]; double (* p_stuff) [3] [3] = and Stuff; do Stuff (p_stuff);} 2) First pass an indicator for the 1D array (the first row) and the number of rows
zero doc (double A [] [3], int lines) {// access them as [0] [0]. [2] [2]} int main () {double content [3] [3]; double ( * P_stuff) [3] = stuff; dostaf (p_stuff, 3);} 3) Pass a column in the first row and the number of columns and lines both < Pre> void dostuff (double a [], int rows, int colals] {// access them as [0] No .. a [8]; } Int main () {double luggage [3] [3]; Double * p_stuff = accessories [0]; Dostf (p_stuff, 3, 3); } (This last option is not strictly consistent with the standards because it gives an array of elements of the 1D array (the first line before the end of that line).)
If it was not a C function, then there would be more options!
Comments
Post a Comment