Search:

Type: Posts; User: Hobbit

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    39
    Views
    5,761

    Why OOP? Design patterns! Can't believe...

    Why OOP?

    Design patterns!

    Can't believe this is 3 pages long and no one seems to have mentioned this.
  2. Start reading here...

    Start reading here if using WinXP or above.
  3. Replies
    31
    Views
    5,667

    Yes it's research code. Yes it's written for GCC....

    Yes it's research code. Yes it's written for GCC. It isn't documented too well, only in code comments and the dissertation, but at the time it was the only lock-free red-black tree I could find. I've...
  4. Replies
    31
    Views
    5,667

    The structures I use were written largely by Dr...

    The structures I use were written largely by Dr Kier Fraser, a research associate at Cambridge University whose dissertation can be read here. This dissertation won the 2004 Distinguished...
  5. You simply needed to change 0xffff to 0xffffU. ...

    You simply needed to change 0xffff to 0xffffU.

    The U tells the compiler that 0xffff is unsigned.
  6. Replies
    4
    Views
    665

    Yes you are not, you need to use va_arg to access...

    Yes you are not, you need to use va_arg to access individual arguments from the list.
  7. Replies
    4
    Views
    665

    Is the missing va_end(valist) the issue? You must...

    Is the missing va_end(valist) the issue? You must match a va_start with a va_end.
  8. What 'type' is 0xffff?? Therein lies he issue....

    What 'type' is 0xffff?? Therein lies he issue. Surprised you didn't work that out yourself.
  9. Thread: C++ Unit tests

    by Hobbit
    Replies
    3
    Views
    683

    In general unit testing is writing test cases for...

    In general unit testing is writing test cases for code that you write, that largely ignores external things such as API usage, databases, networking etc. Mostly those things are mocked. Your tests...
  10. Replies
    2
    Views
    867

    What's the problem? You haven't said. BTW your...

    What's the problem? You haven't said.

    BTW your identifiers are illegal. Names in the global scope starting with an underscore are reserved for the implementation. Names at function scope starting...
  11. Replies
    31
    Views
    5,667

    I'm not sure, I tend to use lock-free structures...

    I'm not sure, I tend to use lock-free structures that are tried and tested and weren't written by me. I've checked the source for my lock free structures this morning and it seems they all use...
  12. Replies
    3
    Views
    906

    OK let's work through these one at a time.... ...

    OK let's work through these one at a time....

    Question 1. You use & when you need the address of something, i.e. for setting where a pointer will point to or for passing the address of an output...
  13. Replies
    31
    Views
    5,667

    You probably don't need those pointers to be...

    You probably don't need those pointers to be volatile. What's the lock-free strategy of your list? Compare and swap?
  14. Replies
    31
    Views
    5,667

    You can almost certainly, volatile is of limited...

    You can almost certainly, volatile is of limited use in C for multithreaded programming, it doesn't do anything for you except turn off optimisations, though there maybe times when that is necessary....
  15. Replies
    31
    Views
    5,667

    Using InterlockedIncrement and family? They take...

    Using InterlockedIncrement and family? They take a non-volatile pointer to volatile data.
  16. Replies
    31
    Views
    5,667

    C and C++ compilers treat volatile pointers the...

    C and C++ compilers treat volatile pointers the same way. Whilst strictly speaking it is undefined behaviour, that's just the standard erring on the side of safety. In this case the OP wants to use...
  17. Replies
    10
    Views
    1,785

    Yes that's right Jim. Visual C++ 1.52 was the...

    Yes that's right Jim. Visual C++ 1.52 was the staple IDE for windows programming on windows 3, 3.1, windows for workgroups (3.11? long time ago)
  18. Replies
    31
    Views
    5,667

    Whilst volatile was more for the days of...

    Whilst volatile was more for the days of interrupt handlers and for use where memory is shared across process boundaries, some interesting applications can arise in multithreaded code. It's main use...
  19. Replies
    31
    Views
    5,667

    Your only option in C is the C-style cast. ...

    Your only option in C is the C-style cast.

    Yes it should be safe to cast away the volatile qualifier on your pointers and C will allow you to do it as C is not particularly type-safe. A second...
  20. Replies
    10
    Views
    1,785

    Why do you need to use a compiler that is now 23...

    Why do you need to use a compiler that is now 23 years old and isn't even compliant with c++98?
    The latest version of visual studio is available for free and happily runs on 64 bit Windows 10.
    You...
  21. Remember a pointer IS an address, well a value...

    Remember a pointer IS an address, well a value interpreted as an address. So the pointer a holds the address of var.

    You can discount D. We have no idea what the function address does. C is the...
  22. Most JS runs in a browser so you will need to dig...

    Most JS runs in a browser so you will need to dig through the source code of browsers to find how the developers have implemented JS. Most browsers are written in C++.
  23. At your coding level I doubt that you would...

    At your coding level I doubt that you would understand it to be honest. No there's not really any easy side by side comparison, and besides you would need to learn the basics of Python and you are...
  24. Just initialise them to 0. It'll work as you...

    Just initialise them to 0. It'll work as you intend and do nothing.


    #include<stdio.h>


    void decompose(float x, int intpart, float fracpart);
    int main()
    {
    int i = 0;
  25. Encapsulation is one thing in C++ that C just...

    Encapsulation is one thing in C++ that C just can't do.

    Programs compile to machine code, byte code is often used as an intermediate step for interpreted languages which don't run in machine code...
Results 1 to 25 of 121
Page 1 of 5 1 2 3 4