How do you return a static multi-dimensional array of letters?
#include & lt; Stdio.h & gt; #to & lt include, conio.h & gt; # Define 3 characters ** My function (zero) {static character orientation [size] [size] = {{'A', 'B', 'C'}, '' D ',' E ',' F ' }, {'G', 'h', 'i'}}; Return arr; } Zero main (zero) {char ** arr1 = NULL; Int i = 0; Int j = 0; Arr1 = MyFunction (); (I = 0; i
First of all, arr can not be a char **
. It's an address, but it's not an indicator's address - it's the address of a letter [size].
I've always typed them out easily by using the fps, dividing the dimensions and solving it.
# Size 3 Type of typed characters [SIZE]; // One line type is an array of characters ROW * MyFunction (zero) {static row ARR [SIZE] = {// arr is an array of rows {A ',' B ',' C '}, {' D ',' E ',' F '}, {' G ',' H ',' I '}}; Return arr; } Zero main (zero) {ROW * arr1 = NULL; // etc ...
Comments
Post a Comment