Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > bitshift

Reply
Thread Tools

bitshift

 
 
Bill Cunningham
Guest
Posts: n/a
 
      11-08-2011
I wrote some code that is now gone or I'd post it. This code took a jpeg
file of around 45Mb and I used the tilde operator to turn it "inside out". I
believe I was successful and when I tried to "reshift" the bits it didn't
work too well. Here's s snippet of what I can remember.

int a,b;
a=~b;

while ((a=fgetc(fr))!=EOF)
fputc(a,fw);

This might not be exact but once the shift was made and the file was
rendered incompatible it couldn't be restored.

Bill


 
Reply With Quote
 
 
 
 
Lew Pitcher
Guest
Posts: n/a
 
      11-09-2011
On November 8, 2011 18:05, in comp.lang.c, http://www.velocityreviews.com/forums/(E-Mail Removed)d wrote:

> I wrote some code that is now gone or I'd post it. This code took a
> jpeg
> file of around 45Mb and I used the tilde operator to turn it "inside out".
> I believe I was successful and when I tried to "reshift" the bits it
> didn't work too well. Here's s snippet of what I can remember.
>
> int a,b;
> a=~b;
>
> while ((a=fgetc(fr))!=EOF)
> fputc(a,fw);
>


Not quite. Your original code was "to take an ELF format file and turn it
inside out". And the code was somewhat more involved than the sample you
posted above.

> This might not be exact but once the shift was made and the file was
> rendered incompatible it couldn't be restored.
>
> Bill
>
>


Yes, Bill, and we discussed the problem when you posted your code.

You can find your original posting at
http://groups.google.com/group/comp....d65513a89893b8
and the entire thread (including the analysis of your code issues) at
http://groups.google.com/group/comp....2175a9c67ec50b

--
Lew Pitcher
Master Codewright & JOAT-in-training | Registered Linux User #112576
Me: http://pitcher.digitalfreehold.ca/ | Just Linux: http://justlinux.ca/
---------- Slackware - Because I know what I'm doing. ------


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bitshift operator problem Serve Laurijssen C Programming 13 09-06-2008 12:46 PM
trouble converting c++ bitshift to python equivalent nanodust@gmail.com Python 6 05-24-2007 09:01 PM
bitshift a large amount of data Eric.Medlin@gmail.com C++ 8 02-10-2006 12:06 AM
What's the point of bitshift? Ryan Java 4 02-14-2005 03:01 AM
Using bitshift in assigning a number to a variable? bollod C Programming 12 12-27-2003 05:45 PM



Advertisments