Search:

Type: Posts; User: doshell

Search: Search took 0.00 seconds.

  1. Replies
    16
    Views
    2,187

    Don't mean to start a flame war on this, but I...

    Don't mean to start a flame war on this, but I believe that casting pointers returned by malloc(), as long as it is properly declared, helps document your code. From an "utilitarian" point of view,...
  2. Here's a (hopefully) clear and (definitely) long...

    Here's a (hopefully) clear and (definitely) long explaination of how it works.

    The first thing you should understand is that it's not the compiler that produces the actual executable from your...
  3. Thread: Parity check

    by doshell
    Replies
    22
    Views
    14,735

    I like this one very much... I would never have...

    I like this one very much... I would never have thought of doing it that way.

    I'll try out the different alternatives anyway. Thanks to all for your suggestions. :)
  4. Thread: Parity check

    by doshell
    Replies
    22
    Views
    14,735

    Hmm, I was expecting someone to point out a less...

    Hmm, I was expecting someone to point out a less obvious way of doing it, instead of the pretty straightforward iteration along individual bits (which at first looked rather unelegant to me).

    Say,...
  5. Thread: Parity check

    by doshell
    Replies
    22
    Views
    14,735

    Parity check

    How can I check the parity of an integer variable (i.e. count the number of '1' bits), without resorting to inline assembly?
  6. Does a struct pointer always point to the struct's 1st member?

    Just a simple question.

    Is it guaranteed that the pointer to a structure always points to the structure's first member?

    e.g.


    struct {
    data_type a;
    data_type b;
Results 1 to 6 of 6