Re: Dynamic arrays
From: Alex (me_at_privacy.net)
Date: 10/29/03
- Next message: Tim Woodall: "Re: Recursive Functions"
- Previous message: Rick: "Re: Dynamic arrays"
- In reply to: sellountos euripides: "Re: Dynamic arrays"
- Next in thread: Irrwahn Grausewitz: "Re: Dynamic arrays"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 29 Oct 2003 13:27:27 -0000
"sellountos euripides" <sellountos@mech.upatras.gr> wrote in message
news:bnod8n$p2p$1@nic.grnet.gr...
> >> if (test= NULL) printf("Can't allocate\n");
> > ^
> > Hur, hur!
> >
> > You want ==.
>
> To OP.
> That's why many programmers prefer to write:
> if (NULL==test) {
> /* ... */
> }
> To catch the error at compile time.
I prefer to increase the warning level from my compiler, which also sets off
an alarm bell in this type of situation:
int i, j;
/* ... */
if (i = /* whoops! */ j) { /* ... */ }
Alex
- Next message: Tim Woodall: "Re: Recursive Functions"
- Previous message: Rick: "Re: Dynamic arrays"
- In reply to: sellountos euripides: "Re: Dynamic arrays"
- Next in thread: Irrwahn Grausewitz: "Re: Dynamic arrays"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]