[A89] Re: A problem


[Prev][Next][Index][Thread]

[A89] Re: A problem




testmap isnt an interger

you would need to do this:

int engine(char fn[], int x, int y)
{
         short i, ii,key,testmap[x][y]; //i changed "int" to "short"
         FILE *f=fopen(fn,"rb");
         getc(f);
         getc(f);
         clrscr();
         fclose(f);
         printf("DONE");
         while(!ngetchx());
         return 1;
}

that should work, tell me if it does

Ryan Cullan



Rob Smith wrote:

> ok, here's the code:
> int engine(char fn[], int x, int y)
> {
>          int i, ii,key,testmap[x][y];
>          FILE *f=fopen(fn,"rb");
>          getc(f);
>          getc(f);
>          clrscr();
>          fclose(f);
>          printf("DONE");
>          while(!ngetchx());
>          return 1;
> }
> When I run this, it works fine until it gets to the int testmap[x][y];
> why does it die? Is there a way to do this better, I want to be able to
> pass the dimensions of the array, can i do this?
> Thanks
>
> ----
> Rob Smith
> Rob's Quote of this Reset:
> A government that robs Peter to pay Paul can always depend upon the support
> of Paul.
> - George Bernard Shaw





Follow-Ups: References: