I think I got it.
Thank you Savage and you too weahnessforcats .
Regards,
mshaaban...
User Profile
Collapse
-
Hello,
Thanks for your reply.
I have a question, in your code; the variable "latmax" what does it have to do with anything did you mean the variable "out"?? so the code should be:
Code:
float** out;
out[row][col] = FMISSING;
Thanks for your help.
Regards,
mshaaban...Leave a comment:
-
passing a pointer to a 2D array to a function!!!!
Hello,
In my code I have a large static 2D arrays defined as:
code:
[code=c]#define LONMAX 1440
#define LATMAX60 480
void main (int argc, char *argv[])
{
.......
float precip60[LATMAX60][LONMAX];
float error60[LATMAX60][LONMAX];
char source60[LATMAX60][LONMAX];
[/code]
I'm passing these arrays to other function...Last edited by AdrianH; Jun 9 '07, 08:14 PM. Reason: Please use [code=c][/code] tags to improve readability. Thanks. -
I agree with you Jos it does work and I tested it.
What I did not get from the previous message is how to pass that pointer to the 2D array; to the fread function
here is part of my code:
#define LONMAX 1440
#define LATMAX60 480
typedef char matrix[LATMAX60][LONMAX];
void main (int argc, char *argv[])
{
.....
matrix1 *source60;
...........Leave a comment:
-
pointer to typedef 2D array
Hello Sir,
In my code I have made a typedef 2D array (large array)
typedef char matrix[matrix_size][matrix_size];
Then in the program I used malloc to allocate memory for the array
matrix *m;
m =malloc(sizeof *m); //Actually i'm using a code from one of your posting
Now in my program I want to use fread to read from a file, a size of one row of this matrix how to do that??...
No activity results to display
Show More
Leave a comment: