Re: string operation??
- From: mark_bluemel@xxxxxxxxx
- Date: 27 Nov 2006 00:52:38 -0800
sethukr@xxxxxxxxx wrote:
hi everybody,
char str[10]="string";
str[0]^=str[1];
can anybody plz tell me the use of ^operator in string???
This isn't a mobile phone. "please" is only a little more typing than
"plz", and the shift key is easy to find. Basic typography a) improves
the readibility of your message and b) makes the reader feel that you
bothered to put in some effort.
Now to the question. In "str[0]^=str[1]" you are not operating on a
string, but on a character in that string. We are doing an exclusive
bitwise or operation with the first two characters and storing the
result in the first. Why the code is doing that is beyond me, though
I'd suspect it was a crude cryptographic technique....
.
- Follow-Ups:
- Re: string operation??
- From: Christopher Benson-Manica
- Re: string operation??
- References:
- string operation??
- From: sethukr@xxxxxxxxx
- string operation??
- Prev by Date: Re: URL decoding/encoding problem
- Next by Date: Re: Reading a string of unknown size
- Previous by thread: string operation??
- Next by thread: Re: string operation??
- Index(es):
Relevant Pages
|
|