Reading .bmp file in C

R

Richard

Bill Cunningham said:
It's a bitwise or, as opposed to ||. Not very funny. I've never used the
bitwise operators so I'm going to read up on them.

As opposed to what? Yo think || is XOR now?

Watch out Linux Torwalds! There's a new man in town. Seriously. Give it
up. You're too transparent. No one can be this clueless.

--
 
B

Bill Cunningham

Ok I guess now after looking at wikipedia that XOR is ^ and | is OR. I
have not really encountered a use yet for these operators.

Bill
 
R

Richard

Bill Cunningham said:
Ok I guess now after looking at wikipedia that XOR is ^ and | is OR. I
have not really encountered a use yet for these operators.

Bill

You don't have a copy of K&R?
 
B

Barry Schwarz

I'm getting better Keith with the functions. But things like the bitwise
operators as a perfect example I have never used. Pointers are another thing
not completely understood. When to declare a pointer and use & for example.
In reading a prototype I would have to experiment.

It doesn't matter whether you have ever used it or not. It is the
idiocy of guessing instead of researching that people are commenting
on.
 
K

Keith Thompson

Bill Cunningham said:
Ok I guess now after looking at wikipedia that XOR is ^ and | is OR. I
have not really encountered a use yet for these operators.

You've said you have a copy of K&R2. Why the ^|&~ would you consult
Wikipedia?
 
J

James Kuyper

Bill said:
Ok I guess now after looking at wikipedia that XOR is ^ and | is OR. I
have not really encountered a use yet for these operators.

I routinely avoid reading discussions that you start; I'm not certain
that you're the troll that some people think you are, but I find it
psychically painful to see lots of good advice aimed at your head which
just bounces off without ever penetrating. Over more than a decade a lot
of good-hearted and very competent people have put a lot of effort into
trying to teach you C. Those same people could have spent the same
amount of effort to turn dozens of ordinary students into expert C
programmers; but it seems to have been utterly wasted on you.

However, I don't have any way to tell my web browser to filter out
entire threads on the basis of the fact that you started the thread; so
occasionally I do end up reading someone else's responses to you.

You've been repeatedly told not to guess at the answers, but to figure
them out. You apologize each time, but continue doing it. You've been
repeatedly told that your copy of K&R is a much better place to look for
answers than virtually any other source you are in the habit of using,
but it seems as though you almost never use K&R. You apologize each
time, and keep doing it.

There's unfortunately nothing unusual about people failing to take good
advice; but I'm curious if, instead of an apology, you could give us any
actual reason you had for ignoring the advice, even if it is a bad reason.
 
R

Richard

James Kuyper said:
I routinely avoid reading discussions that you start; I'm not certain
that you're the troll that some people think you are, but I find it
psychically painful to see lots of good advice aimed at your head
which just bounces off without ever penetrating. Over more than a
decade a lot of good-hearted and very competent people have put a lot
of effort into trying to teach you C. Those same people could have
spent the same amount of effort to turn dozens of ordinary students
into expert C programmers; but it seems to have been utterly wasted on
you.

However, I don't have any way to tell my web browser to filter out
entire threads on the basis of the fact that you started the thread;
so occasionally I do end up reading someone else's responses to you.

You've been repeatedly told not to guess at the answers, but to figure
them out. You apologize each time, but continue doing it. You've been
repeatedly told that your copy of K&R is a much better place to look
for answers than virtually any other source you are in the habit of
using, but it seems as though you almost never use K&R. You apologize
each time, and keep doing it.

There's unfortunately nothing unusual about people failing to take
good advice; but I'm curious if, instead of an apology, you could give
us any actual reason you had for ignoring the advice, even if it is a
bad reason.

I suspect he's the alter-ego of one of the ruder "regs". They feel they
have amended for their hateful, egotistical ways by responding politely
and calmly to someone who is obviously either simple or a troll. I think
troll but he does it so well... As Robert Downey Jr says (in the role of
a black soldier following a skin pigment augmentation) - "You made the
mistake of going 'full retard'".
 
B

Bill Cunningham

Malcolm McLean said:
At first sight the bitwise operators may appear entirely useless. Who
wants to set a bit to one if an only if two bits in the inputs are set?

However you'll soon realise that they are in fact very useful.

For instance

if( x & 1) /* if x is an odd number */

x & = 0xFF00; /* clear the lower 8 bits of x, also any bits above 16 */

lightswitch ^= 1; /* a toggle. The lightswitch goes on if it is off and
vice versa */

x <<= 1; /* these two lines will collect a series of bits in
integer */
x |= newbit; /* x, for instance for a compression algorithm */

Is the x you are working with a char ?

Bill
 
K

Keith Thompson

Bill Cunningham said:
Is the x you are working with a char ?

Will either a yes or no answer to that question be of any use to you?

The bitwise operators work on integer (and yes, char is an integer
type). Most of the time they *should* be used on unsigned integers
(char may be either signed or unsigned).

I don't think you have enough understanding of the bitwise operators
for your question to be meaningful. K&R2 discusses these operators.
Come back when you've read it.

BTW, I see you're now using <[email protected]> as your return address.
My advice was to use ".invalid", not ".inv". The relevant RFC
guarantees that there will never be a ".invalid" top-level domain; it
makes no such guarantee about ".inv". This is yet another case where
you change something without understanding what you're doing.
 
B

Bill Cunningham

Keith Thompson said:
You've said you have a copy of K&R2. Why the ^|&~ would you consult
Wikipedia?

I happened to be online, looked up wikipedia quickly and found my
answer. Otherwise I would have to leave the computer immediately dig through
some books and thought I'd leave that for later.

Kand R2 is very much a mouthful, or should I say head ful. I have
learned more at times from other texts and the help I get here and other
places. Nevertheless I do consult it from time to time.

Bill
 
B

Bill Cunningham

It doesn't matter whether you have ever used it or not. It is the
idiocy of guessing instead of researching that people are commenting
on.

What makes you think I am not researching things. I immediately went to
wikipedia to find out answers fast. I will read up on kandr2 when I decide
to use bitwise operators then if I am confused I will inquire here.

Bill
 
B

Bill Cunningham

Then ignore them, or learn about them, at your leisure. But guessing is
just ludicrous.

When I am ready to research them I will read kandr2 or something similar
if kandr2 is too much of a mouthful, and ask if confused accordingly. but I
immediately went to wikipedia to find answers fast while online.

Bill
 
B

Barry Schwarz

What makes you think I am not researching things. I immediately went to

No you didn't. Your immediate response was to guess.
wikipedia to find out answers fast. I will read up on kandr2 when I decide

You have been told repeatedly that Wikipedia is not authoritative. Why
use it when you have K&R?
to use bitwise operators then if I am confused I will inquire here.

If you have no intention of using them in the near future, why did you
start this discussion? By your own admission, you won't remember it
when the time comes.
 
B

Bartc

I don't understand why anyone who's been here more than a week even reads
his posts. Whatever the reason, it's not worth time even reading, much
less answering, posts with his name on it. It's like optimizing a program:
don't waste time on the areas where your work won't make any difference.
Nothing personal, just that measurement has shown that effort spent
answering his posts is wasteful.

Sometimes Bill's posts start a discussion on some aspect or other that may
be of interest to others reading the newsgroup.

Although the meaning of ^ and | probably isn't one of those..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top