+ sign

I know that ++ is a increment of 1, but what is +?

Because in my book its got:
iTickTrigger = iTickCount +

That is a really good question, and to be honest, I don't know. The only thoughts that jump to mind are that it is missing something that is being added to iTickCount or it is some extremely odd way of writing +=.
I can't see this being valid syntax, but don't quote me on that. Which text book are we talking about here?
It is probably
iTickTrigger += iTickCount
or
iTickTrigger = iTickCount ++.It should be clear from the context,i.e rest of the code.
@quirkyusername, I think you're right, if it's var = var +, the program would likely look for something to be added to var.
looks like an addition sign
looks like an addition sign
Why didn't I think of that? Hey, you're one post away from 100.
closed account (D80DSL3A)
Here's a wild idea - try using it in a program instead of speculating about it.
It doesn't appear to be legal by itself.
1
2
3
4
5
6
int main(void)
{	
	int val1=0, val2=3;
	val1 = val2+;// error this line.	
	return 0;
}

cpp(14) : error C2059: syntax error : ';'

@TpOreilly: In what context does this appear?
Last edited on
Maybe the code is spread across more than one line?
i.e.

1
2
3
4
5
6
7
int val1 = 0;
int val2 = 5;

val1 = val2 +
	76;

std::cout << val1 << '\n'


output:
81
Lynx876, you are right. Here is the full code:

1
2
iTickTrigger = iTickCount +
              GameEngine::GetEngine()->GetFrameDelay();


I should have realised when i never saw a ";"!!

I read these two lines of code as seperate peaces of code because they are on seperate lines, and because these two lines could fit on to one single line.
It's common practice to spread expressions over multiple lines if they are this long. Of course some people prefer to stuff everything into a single line, I personally think it's easier to read when you limit a line to about 80-100 characters.
:D
Topic archived. No new replies allowed.