User Profile

Collapse

Profile Sidebar

Collapse
mshaaban
mshaaban
Last Activity: Jun 12 '07, 12:20 AM
Joined: Jun 7 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • mshaaban
    replied to pointer to typedef 2D array
    in C
    I think I got it.
    Thank you Savage and you too weahnessforcats .
    Regards,
    mshaaban...
    See more | Go to post

    Leave a comment:


  • 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...
    See more | Go to post

    Leave a comment:


  • mshaaban
    started a topic passing a pointer to a 2D array to a function!!!!
    in C

    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...
    See more | Go to post
    Last edited by AdrianH; Jun 9 '07, 08:14 PM. Reason: Please use [code=c][/code] tags to improve readability. Thanks.

  • mshaaban
    replied to pointer to typedef 2D array
    in C
    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;
    ...........
    See more | Go to post

    Leave a comment:


  • mshaaban
    started a topic pointer to typedef 2D array
    in C

    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??...
    See more | Go to post
No activity results to display
Show More
Working...