Search:

Type: Posts; User: tieske

Search: Search took 0.00 seconds.

  1. I (wrongly) assumed pointers to be mere integer...

    I (wrongly) assumed pointers to be mere integer values denoting a memory address from 0 to end-of-memory, in byte order. How wrong I am; K&R, 2nd edition, Ch 5, p. 102;
    I would still expect it to...
  2. A now I get your comment. Maybe I should have...

    A now I get your comment. Maybe I should have been clearer in my initial post. It is very common with functions that return an integer, that an impossible range of outcomes is used as error signals....
  3. It does, it has a single check to see whether...

    It does, it has a single check to see whether there is an error, and only in the error case you would traverse the possible error codes to find out what exactly went wrong. This is no different than...
  4. That is wat the example does? or am I missing...

    That is wat the example does? or am I missing something. As long as all the errorcodes are defined using the same array, it works.
  5. So... I crafted evil code and will burn in hell...

    So... I crafted evil code and will burn in hell forever...


    So here's my big miss. Thx for pointing that out, that is indeed a big issue.



    Those arguments can be overcome, the array has...
  6. Thanks for the quick and thorough responses. So...

    Thanks for the quick and thorough responses. So my googling didn't turn anything up because it can't be done that way.
    Disappointing, but not giving up, I created the test code below;


    static...
  7. returning an error code from a function that has a pointer return type

    I have tried several google searches, but probably use the wrong keywords to find this.

    I have a function that returns a pointer type, now if the function detects an error condition I would like...
Results 1 to 7 of 7