# Help I'm Hopelessss

This is a discussion on Help I'm Hopelessss within the C++ Programming forums, part of the General Programming Boards category; I'm sorry I can't reply for some reason so if u feel u need to replace this go ahead. I'm ...

1. ## Help I'm Hopelessss

I'm sorry I can't reply for some reason so if u feel u need to replace this go ahead.

I'm messing around with the NOT !.
At the first place I did like this !(1 || 0) and that suppose to be true I guess, but it doesn't recognize the '!'. Then I did a thread here and some guy told me it suppose to be (!true) but that didn't work either so what SHOULD I DO?!?!?!? pls help

HELPPPPP pls

2. oh and if it is (!true) so how do I make it like first evaluate (1 || 0) then evaluate NOT. (1 || 0) = true but NOT makes it false.

3. !(1 || 0) and that suppose to be true I guess
No, it's not.

What do you mean by "not recognize"? You get a compile error?

4. (1 || 0) evaluates to true. !(1 || 0) evaluates to false.

if you do this:
Code:
`if !(1 || 0)`
you will get a compile error. Do this:
Code:
`if (!(1 || 0))`

5. ## Thankkkkss

WOOWW thanks it's really (!(1/0)) and recognize = identify

6. oh 1 last question: how do I make && evaluate after ||? means: if I do (1 || 1 && 0) that's not like 1 || 1 = 1 && 0 = 0

it's 1 && 0 = 1 then 1 || 1 = 1
I want AND to be evaluate before OR, how do I do that?

7. = is assignment, == is comparison for equality.
To change the order in which subexpressions are evaluated, use () just like you do in math expressions.

8. Originally Posted by mat13mat
WOOWW thanks it's really (!(1/0)) and recognize = identify
if something
Is illegal.
if (something)
Is legal.

Therefore, the error was that you did not write the if properly.

Here's an example of your second q:
if ( 1 || (1 && 0) )

9. Here's an example of your second q:
if ( 1 || (1 && 0) )
which is equivalent to
if ( 1 || 1 && 0 )

10. I think I've an idea now how it was supposed to be. If && is to be first, then place it first:
if ( (1 && 0) || 1 )
Parenthesises make the expression less ambiguous, so I'd definitely recommend them, even if they are not required.

11. mat13mat: You say you want to evaluate && after ||, but then you proceed to give examples of the opposite.

If && is to be first, then place it first:
That may help readability, but has zero effect on actual semantics. && always comes first because it has a higher precedence than ||. If you want to change this, you have to add extra parentheses around the OR expression.

12. I don't know if some1 will answer this here so I'll post a thread too, gm do w/e u want.
If I make 2 files in 1 project, and I execute it, but I want to execute only 1 file how do I do it?
I made a project with 2 files in it, 1 is int main() and 1 is int submain() now how do I execute the submain file? only int main() executes and I get to errors pls help.

13. Functions needs to be called.
Int main gets called upon program startup. Any other function you must call manually. There are not special.

14. What C++ book are you using that doesn't cover this?