comp.lang.c
[Top] [All Lists]

Re: Why this program fails for larger input value ?

Subject: Re: Why this program fails for larger input value ?
From: Kenneth Brody
Date: Tue, 29 Apr 2008 15:27:43 -0400
Newsgroups: comp.lang.c

pereges wrote:
[...]
>         typedef struct point
>     {
>                 float x, y;
>       } point;
>         point *pointinarray;
> 
>         pointinarray = calloc(sizeof(point), numpoints);
[...]
> The program is working for anything upto 60000 or so but fails for
> anything greater eg. 100000

"Fails", how?

Pure speculation: the calloc(), for which you do not check for
failure, is failing on large values of "numpoints".

-- 
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody        | www.hvcomputer.com | #include              |
| kenbrody/at\spamcop.net | www.fptech.com     |    <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap@xxxxxxxxx>


<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy