Shorthand if()?
1
Name:
Anonymous
2008-05-06 4:39
sup /prog/ ,
I was wondering whether any of you would use in lieu of
if(cond)
do_something();
the equivalent
cond && do_something();
or something like this for a function that returns 0 on error:
(s=get_foo()) || fprintf(stderr,"Error getting foo\n");
of course, multiline if-statements would be a bad idea with this, but how about if statements with a single body statement?
41
Name:
Anonymous
2011-02-27 11:13
>
>
> Okay
42
Name:
Anonymous
2011-02-27 11:14
Okay
43
Name:
Anonymous
2011-02-27 11:14
Test
44
Name:
Anonymous
2011-02-27 11:15
:GJS1M 67dcbdbce4a0b67c4b48e86a6ae29205a95e4b83024a9d947213d1231800e8d9
:48 748c7c773bc63341711e734e49dab7ff
:1210062420 1298823288
>>17
<-- check my doubles
45
Name:
Anonymous
2011-02-27 11:15
Test
46
Name:
Anonymous
2011-02-27 11:21
> > > > > Test
47
Name:
Anonymous
2011-02-27 11:21
> > > > Test
48
Name:
Anonymous
2011-02-27 11:22
Test
Test
Test
Test
49
Name:
Anonymous
2011-02-27 11:22
Test
Test
Test
Test
50
Name:
Anonymous
2011-02-27 11:23
Test
Test
Test
Test
51
Name:
Anonymous
2011-02-27 11:24
Test> > > Test> > > Test> > > Test
52
Name:
Anonymous
2011-02-27 11:25
Test > > > Test > > > Test > > > Test
53
Name:
Anonymous
2011-02-27 11:42
> > > > > > > > > > >
Oh my.
54
Name:
Anonymous
2011-02-27 12:25
Test </span>
55
Name:
Anonymous
2011-02-27 12:25
:GJS1M 67dcbdbce4a0b67c4b48e86a6ae29205a95e4b83024a9d947213d1231800e8d9
:48 f4ba707282cb2a7da2b0fb566f05b26e
:1210062420 1298827536
>>25
<-- check my doubles
56
Name:
Anonymous
2011-02-27 12:30
57
Name:
Anonymous
2011-02-27 12:34
Test
58
Name:
Anonymous
2011-02-27 12:36
Test!
59
Name:
Anonymous
2011-02-27 12:37
Try2
60
Name:
Anonymous
2011-02-27 12:48
Test
61
Name:
Anonymous
2011-02-27 12:51
Test
Test
62
Name:
Anonymous
2011-02-27 12:52
Test
63
Name:
Anonymous
2011-02-27 13:06
The thingAbout
These quotes
64
Name:
Anonymous
2011-02-27 13:07
The thing
About
These quotes
65
Name:
Anonymous
2011-02-27 13:34
The thing
About
These quotes
66
Name:
Anonymous
2011-02-27 13:34
:GJS1M 67dcbdbce4a0b67c4b48e86a6ae29205a95e4b83024a9d947213d1231800e8d9
:48 03afdcc6134cf2bd3734500dca6c3c0d
:1210062420 1298831645
>>28
<-- check my doubles
67
Name:
Anonymous
2011-02-27 13:35
The thing
About
These quotes
68
Name:
Anonymous
2011-02-27 13:40
The thing
About
These quotes
69
Name:
Anonymous
2011-02-27 13:42
The thing
About
These quotes
70
Name:
Anonymous
2011-02-27 13:44
The thing
About
These quotes
71
Name:
Anonymous
2011-02-27 13:44
The thing
About
These quotes
72
Name:
Anonymous
2011-02-27 14:05
1
2
3
73
Name:
Anonymous
2011-02-27 14:32
1
2
3
74
Name:
Anonymous
2011-02-27 14:36
1
2
3
75
Name:
Anonymous
2011-02-27 14:40
1
2
3
76
Name:
Anonymous
2011-02-27 15:50
1
2
3
77
Name:
Anonymous
2011-02-27 15:51
:GJS1M 67dcbdbce4a0b67c4b48e86a6ae29205a95e4b83024a9d947213d1231800e8d9
:66 2a03a48087b1fc79c033c5868dfb074b
:1210062420 1298839863
>>73
<-- that's cool and all, but check 'em
78
Name:
Anonymous
2011-02-27 15:53
Understanding
the damn
line-break.
79
Name:
Anonymous
2011-02-27 15:55
Damn
this
line-break.
80
Name:
Anonymous
2011-02-27 16:01
1 2 3
4
5
6
Newer Posts