By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,234 Members | 1,872 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,234 IT Pros & Developers. It's quick & easy.

!(x>b)

P: n/a
Why does my compiler says there is a syntax error on this instruction?

if !(position<v.m_size && position>0)
Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"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

P: n/a

"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

P: n/a

"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 discussion thread is closed

Replies have been disabled for this discussion.