[A89] Re: A problem


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

[A89] Re: A problem




Hi!

| right now, 100x100 but is there a better way, as not to restore space on
| the stack and keep file size down?

100 * 100 * (2 Bytes) = 20000 Bytes

That's too much space to reserve on the stack: A little more than 16000
Bytes minus a little less than 4000 Bytes (I think) for SAVE_SCREEN makes
about 12000 Bytes left for you.  Making it an array of char instead of int
might work, then again it might not.

Reserving space with malloc or calloc is all right and doesn't increase the
file size.  You have to make sure that enough memory is left, though.

| >Because it's more general.  Arrays are, in fact, passed as pointers (yes,
I
| >have learned).  I don't know if it would still work if you passed a
string
| >>from a char* variable.  It might.
|
| I tried, and it gave me a memory violation, but it is nice to know that.

I'll look at your code tomorrow.

Bye,
Sebastian





References: