Call and compare the same value

Hey guys I got this code here that I thought would check if pointed is greater than itself but every time I call info pointed seems to be equal to itself and cannot be greater how would I go about checking if pointed is different from itself?

1
2
3
4
5
6
7
8
9
 int main()
{
	while(1)
	{
	info();
	if(pointed >> pointed)
	derp();
	}
}
x will always equal x no matter how you write the code.

Since you clearly have not thought this out and probably need to be convinced, here is the code i think will work for you.

if(pointed || pointed) // check to see if equal
or
if(pointed != pointed) // check to see if not equal
>> is the bitwise right-shift operator. You should be using > to test the greater-than condition.

However, the rest of the question doesn't make much sense, the variable will always be equal to itself. The code also doesn't indicate the type of pointed, is it a user-defined type?
pointed is a value from a pointer using rpm, how would I go about checking if its greater than itself though? since its always going to equal to itself
Last edited on
The code to check if it is greater than itself would be if (pointed > pointed) { /* stuff */ }, but I don't know why you would ever do this. A variable can never be greater than itself; that doesn't make any sense.
Topic archived. No new replies allowed.