[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Need Orca/C help...
- Subject: Need Orca/C help...
- From: seane@pro-scat.cts.com (Sean Eller)
- Date: Sun, 16 May 93 16:13:41 EST
- Newsgroups: comp.sys.apple2
- Organization: ProLine [pro-scat] St. Petersburg, Florida.
I'm working on a project that uses arrays and I wanted to clear the array
to zero after intializing it. So this is the code I was using:
int array[100] [100];
unsigned x;
unsigned y;
for (y = 0; y < 100; ++y)
{
for (x = 0; x < 100; ++x)
array[y][x] = 0;
{
It works fine but takes forever. I looked in the manual and it says I can
use the function calloc to do the same thing and it will clear the memory
with zeros automatically. My question is: How would I use the above
example with calloc and then access the array at a later time? I think it
uses pointers but I'm not sure of how to write or read from the array.
Before if I wanted to write or read it would simply be this:
array[5][10] = 1
or getvalue = array[5][10]
Thanks...
----
ProLine: seane@pro-scat
Internet: seane@pro-scat.cts.com
UUCP: crash!pro-scat!seane
America Online: tacheon@aol.com