473,396 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

!(x>b)

Why does my compiler says there is a syntax error on this instruction?

if !(position<v.m_size && position>0)
Jul 23 '05 #1
3 1248
"stephane" <st*************@bluewin.ch> wrote:
Why does my compiler says there is a syntax error on this instruction?

if !(position<v.m_size && position>0)


The entire expression needs to be in parentheses:

if (!(position<v.m_size && position>0)) .....

Jul 23 '05 #2

"stephane" <st*************@bluewin.ch> wrote in message
news:42**********************@news.sunrise.ch...
Why does my compiler says there is a syntax error on this instruction?

if !(position<v.m_size && position>0)

if (!(position<v.m_size && position>0))
Regards,
Sumit.
Sumit Rajan <su*********@gmail.com>
Jul 23 '05 #3

"stephane" <st*************@bluewin.ch> wrote in message
news:42**********************@news.sunrise.ch...
Why does my compiler says there is a syntax error on this instruction?
Because there is.

if !(position<v.m_size && position>0)


Tthe entire conditional expression of 'if' must
be inside the parentheses:

if (!position<v.m_size && position>0)

Then you need to decide which expression to which
you want to apply the '!' operator:

'position', or
'position < v.m_size', or
'position < v.m_size && position', or
'position < v.m_size && position > 0'

and supply the appropriate parentheses.
-Mike
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.