d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Basic C Question
Add Reply New Topic New Poll
Member
Posts: 18,413
Joined: Sep 18 2005
Gold: 4,827.00
Oct 4 2015 10:01pm
I have this review question that I am not sure about and was wondering if anyone would be able to give me some insight..

The question is ..

Is the expression on the second line legal? Why or why not? What does it mean?
int x;
... &&x ...

My guess would be that it isn't legal because x is not a pointer of any sort you would use & to obtain the address of x if you were to use & at all?

Thanks
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Oct 4 2015 10:32pm
sounds like a great example you can put into a compiler to see the result.

are you sure && is for pointers and not the logical AND operator?
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Oct 5 2015 05:04pm
did he really type a bunch of dots, &&x, then more dots? what a dick

not that I think it changes much. IIRC in C, 0 is false, all other values equate to true
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll