Re: C or C++ for FOSS/linux?
- From: Sebastian 'lunar' Wiesner <basti.wiesner@xxxxxxx>
- Date: Fri, 29 Dec 2006 23:48:45 +0100
Chris F.A. Johnson <cfajohnson@xxxxxxxxx> typed
On 2006-12-29, Sebastian 'lunar' Wiesner wrote:
Jan Panteltje <pNaonStpealmtje@xxxxxxxxx> typed[snip]
int *i = (int *) malloc (100*sizeof(int));
I don't know much of C programming, but that is known to me as the
way you allocate an array of 100 integers on the heap in C.
Wrong; it's:
int *i = malloc (100*sizeof(int));
You should not cast the value returned by malloc; that can mask
errors.
Thanks for the correction. As I said, I have only little experience with
C, because I try to avoid it whenever possible... I strongly dislike C.
--
Freedom is always the freedom of dissenters.
(Rosa Luxemburg)
.
- References:
- C or C++ for FOSS/linux?
- From: Beowulf
- Re: C or C++ for FOSS/linux?
- From: Jan Panteltje
- Re: C or C++ for FOSS/linux?
- From: Sebastian 'lunar' Wiesner
- Re: C or C++ for FOSS/linux?
- From: Jan Panteltje
- Re: C or C++ for FOSS/linux?
- From: Sebastian 'lunar' Wiesner
- Re: C or C++ for FOSS/linux?
- From: Jan Panteltje
- Re: C or C++ for FOSS/linux?
- From: Sebastian 'lunar' Wiesner
- Re: C or C++ for FOSS/linux?
- From: Chris F.A. Johnson
- C or C++ for FOSS/linux?
- Prev by Date: Re: C or C++ for FOSS/linux?
- Next by Date: Re: Building enterprise websites with apache
- Previous by thread: Re: C or C++ for FOSS/linux?
- Next by thread: Re: C or C++ for FOSS/linux?
- Index(es):
Relevant Pages
|