Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ If statements

Name: Anonymous 2008-03-15 6:49

I started reading a C++ book today and I've got a question for all you expert programmers:
is it possible to include AND\OR in IF statements?
For example, something like this:

if (variable1 = variable2) or (variable1 = variable3)
    cout<<"whatever";

If so, how?
Or is that just not part of the language?

Name: Anonymous 2008-03-15 6:49

It's not part of the language, you have to emulate the behavior with duplex pipes.

Name: Anonymous 2008-03-15 6:51

>>2
alright, thanx for the help

Name: Anonymous 2008-03-15 8:06

You need inline Assembly to do that

Name: Anonymous 2008-03-15 8:31

op here:
i turned to the next page and then facepalm.jpe'd at myself

sorry for my stupidity

Name: Anonymous 2008-03-15 8:33

op here:
i turned to the next page and then i went to order myself a copy of the wizard book
 
sorry for my stupidity

Name: Anonymous 2008-03-15 8:34

>>5
No problem, come again. We welcome new programmers here, and if you need any advice, just bump this thread. Thanks for visiting our board. :-)

Name: Anonymous 2008-03-15 8:35

>>1
if(foo == bar || foo==foobar)//or

if(foo == bar && foo==foobar)//and

Also note that || has a lower priority and in an or statement, if foo==bar, foo==foobar will not be tested unless the | operator is used. Same if foo!=bar unless the & operator is used instead of &&.

What's the output of :
int i;
i++&&i++||i++&&i++;
std::cout<<i;
3

Name: Anonymous 2008-03-15 8:43

8<<
wow, thanx

Name: Anonymous 2008-03-15 9:12

>>9
>>=8

Name: Anonymous 2008-03-15 9:46

how do you xor?

Name: Anonymous 2008-03-15 9:47

>>10
Expert monadic quoting (BTW, I invented it).

Name: Anonymous 2008-03-15 9:48

Lack of logical `or' is why Haskell sucks and nobody uses it.

Name: Anonymous 2008-03-15 9:59

>>11
a XOR b is equivalent to !(!(a || b) || (a && b)).

Name: Anonymous 2008-03-15 10:09

>>14
thanx

Name: Anonymous 2008-03-15 10:09

>>14
thanx

Name: sage 2008-03-15 12:12

Name: Anonymous 2008-03-15 12:13

fail

Name: Anonymous 2008-03-15 13:07

#define and &&
#define or ||
#define not(x) !(x)

Name: Anonymous 2008-03-15 13:13

#include <iso646.h>

Name: Anonymous 2008-03-15 13:13

#define maybe(x) (rand() & 1 ? (x) : !(x))

Name: Anonymous 2008-03-15 13:26

>>21
lol'd

Name: Anonymous 2008-03-15 13:54

>>21
this is useful

Name: Anonymous 2008-03-15 16:44

Helpful advice on my /prog/?

It's more likely than you think!

Name: Anonymous 2008-03-15 16:51

>>24
It's sepples, they have enough problems.

Name: Anonymous 2008-03-15 17:42

Okay, this thread is now about w3m-emacs.

I do everything I am supposed to do, put the (require 'w3m-load) in the init file, but EMACS refuses to find it. I have explicitly added the exact location of the w3m-load to the load-path, but with no avail. I see that all other files in the w3m dir are byte-compiled, and that might be the case, but EMACS does not compile w3m-load, it just pretends I didn't input the command. Help?

Name: Anonymous 2008-03-15 17:52

Also, normal w3m is working fine, I'm posting from it right now.

Name: Anonymous 2008-03-15 17:55

>>25

You have absolutely no idea how hard i lol'ed... seriously it was epic, the Polar Ice caps melted slightly more; it was That loud.

Name: Anonymous 2008-03-15 18:08

>>28
You lie.

Name: Anonymous 2008-03-15 18:27

>>29

We'll see

Name: Anonymous 2008-03-15 18:31

>>30
How?

Name: Anonymous 2008-03-15 18:37

>>31

You'll know, soon enough

Name: Anonymous 2008-03-15 18:37

>>11
^

Name: Anonymous 2008-03-15 18:38

>>32

Thats not soon enough!

Name: 29,31 2008-03-15 18:39

>>34
OH FUCK YOU GOOD JOB STEALING MY TURN IN THE DISCUSSION NOW I'LL HAVE TO WAIT FOR THE OTHER GUY'S REPLY TO YOUR SHITTY POST SO I CAN GO ON ASSHOLE.

Name: Anonymous 2008-03-15 19:10

>>26
Shouldn't a simple (require 'w3m) do the trick?

Name: Anonymous 2008-03-15 19:21

Tried it, same thing happens.

Name: Anonymous 2008-03-15 19:24

>>37
What emacs version are you using?

Name: Anonymous 2008-03-15 19:30

>>38
GNU Emacs 22.1.1 (i486-pc-linux-gnu, GTK+ Version 2.12.0) of 2007-10-05 on palmer

Name: Anonymous 2008-03-16 19:29

>>34

Your mom; I hope she's drowned by the melted ice caps...

I will feast on the delcious irony1

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List