TIP: Click on subject to list as thread! ANSI
echo: nthelp
to: John Beckett
from: Geo
date: 2004-11-22 05:59:16
subject: Re: C++ for beginners?

From: "Geo" 

"John Beckett"  wrote in
message news:h2n2q0h6o30p2o6ahtj1b43gbi3ttnbgqf{at}4ax.com...

> I hope you realise that Tony's suggestion:
>      x ^= y ^= x ^= y;
> was very tongue-in-cheek.

Actually no, I used to do a bit of 6502 assembler and used stuff like that
all the time. If the compiler would choke on it then ok but as far as an
operation it sure looks like the way I used to do things.

> The ^ (bitwise xor) operator is only defined for integer variables. It
> is probably illegal (compiler error) with float or string.

Well there is no string, so it could be handled as char and I don't see why
you can't do an xor on a character, I mean it seems to me that *should* be
a valid operation.

> You could argue that a more clever language would know that the TRUE
> contents of a string was the actual characters, but C/C++ is not like
> that. Xor is supported in so far as the CPU supports it.

Are you saying there is a structure for a string type variable? We learned
that only way to do a string was with an array of characters.

Geo.

--- BBBS/NT v4.01 Flag-5
* Origin: Barktopia BBS Site http://HarborWebs.com:8081 (1:379/45)
SEEN-BY: 633/267 270 5030/786
@PATH: 379/45 1 396/45 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.