+ 1

What is wrong in my code??

go to code and tell me the difference between line 1 and line 2(both lines given in code) https://code.sololearn.com/c3YnbsJsiitr/?ref=app

6th Feb 2020, 1:52 PM
Prakhar
10 Antworten
+ 2
logically speaking, the line 1 is more appropriate, since you're check "p" first (p may contain NULL) before the second sub expression gets called. ( as the "&&" operator is part of short-circuit evaluation. thus, will guarantees that the second sub-expression will never be called if the first sub-expression evaluates to false)
6th Feb 2020, 3:42 PM
MO ELomari
MO ELomari - avatar
+ 5
Both lines are statement so you should keep in comment.
6th Feb 2020, 1:55 PM
A͢J
A͢J - avatar
+ 5
Prakhar There is no difference in both line only statements are different. If you will not comment the both line then exception will come.
6th Feb 2020, 2:06 PM
A͢J
A͢J - avatar
+ 3
Prakhar Outputs are coming same. May I show you through video?
6th Feb 2020, 2:13 PM
A͢J
A͢J - avatar
+ 2
Prakhar Check here. Outputs are coming same. https://www.sololearn.com/post/237167/?ref=app
6th Feb 2020, 2:16 PM
A͢J
A͢J - avatar
+ 2
Prakhar Don't confuse me. It's working fine. I have shown you in video also.
6th Feb 2020, 2:30 PM
A͢J
A͢J - avatar
+ 2
Prakhar Make a video through screen recorder and share here.
6th Feb 2020, 2:31 PM
A͢J
A͢J - avatar
0
Bro I want to ask is there any difference between line 1 and 2 ..if no? then erase one of them one by one and find the output..And if there is difference between lines then tell me please..
6th Feb 2020, 1:58 PM
Prakhar
0
If there is no difference between the lines then first erase line 1 and find output and then erase line 2(keeping line 1) and find the output both will be different even after line 1 and 2 are same.. I want to know this.. Why this happened..
6th Feb 2020, 2:10 PM
Prakhar
0
There are two lines marked as //line 1 &//line 2,first erase the statement marked as //line 1(notice output) now, (Press back again come to code via link) this time erase the statement marked as //line 2(notice the output).. Both are different
6th Feb 2020, 2:24 PM
Prakhar