-2

This is a sample of how I tried to pass the array to a function, it is not the actual function used but this one gives the same result. I get incomprehensible numbers whereas if I print the array from the main function it prints just fine. If it's something obvious, I'm sorry in advance but I'm new to using fucntions. Thanks!

I am using the call function: print(NP,EP,InputArray);

void print(int NP,int EP,double InputArray[][EP])
{
    int qw,er;
    for(qw=0;qw<NP;qw++)
    {
        for(er=0;er<EP;er++)
        {
            if(er==EP-1)
            {
                printf("%lf\n\n",InputArray[qw][er]);
            }
            else
            {
                printf("%lf\n",InputArray[qw][er]);
            }
        }
    }
}
Michael K
  • 1
  • 1

1 Answers1

-1

Turns out this syntax doesn't work for codeblocks. Tried DevC++ and works just fine.

Michael K
  • 1
  • 1