Search:

Type: Posts; User: Brafil

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. Best way to implement instance-dependent object factories?

    Hey, I'm working on a project incorporating runtim e modules. Several class interfaces are given which are then loaded dynamically. The library doesn't need to know about any of these classes except...
  2. Replies
    15
    Views
    1,951

    Depends mostly on IO speed. Appending three...

    Depends mostly on IO speed. Appending three characters to a line (even if it's ten million lines) shouldn't be too slow. Read one line at a time, strcat the characters and write.
  3. Replies
    4
    Views
    1,603

    If you want to be portable, you can use limits.h...

    If you want to be portable, you can use limits.h and then check for a variable that matches U<TYPE>_MAX == 1 << 31.
  4. Replies
    4
    Views
    31,249

    AFAIK, it does not work correctly in MSVC. The...

    AFAIK, it does not work correctly in MSVC. The return value etc.
  5. Replies
    17
    Views
    15,541

    @jephtah: Don't forget alignment. The size of a...

    @jephtah: Don't forget alignment. The size of a structure may be more than the individual sizes of its elements.
  6. Replies
    9
    Views
    1,412

    Generally like this. For safety reasons. ...

    Generally like this. For safety reasons.


    C:\\Program Files\\Program\\Program.cpp
  7. Thread: MAC LInux C++

    by Brafil
    Replies
    1
    Views
    697

    This looks like an assignment. If you've read the...

    This looks like an assignment. If you've read the rules, you'd know that we won't do your homework for you, just help if you have a question.

    Looking up a reference for netdb.h should be enough.
  8. Either use long long or long double, both should...

    Either use long long or long double, both should work correctly up to 15 digits. No need for extra libraries.
  9. Replies
    21
    Views
    2,067

    (There was a touch of irony in it) I know that...

    (There was a touch of irony in it)

    I know that this is used, but why -0? For IDK, but sounds bad?
  10. Replies
    21
    Views
    2,067

    It was the first time I ever did this, have mercy!

    It was the first time I ever did this, have mercy!
  11. Thread: return value

    by Brafil
    Replies
    6
    Views
    2,115

    Yes. It's undefined.

    Yes. It's undefined.
  12. Replies
    6
    Views
    820

    1. sscanf might as well read too many characters,...

    1. sscanf might as well read too many characters, use "%c"
    2. In every case it will append a NUL at the end of the array. If you enter a letter, the NUL will go past the array, invalidating memory.
  13. Replies
    21
    Views
    2,067

    @Elysia: +1

    @Elysia: +1
  14. Replies
    29
    Views
    2,086

    Internally AFAIK the processor just treats them...

    Internally AFAIK the processor just treats them as 80 bit-doubles. If they take 16 bytes, then this is far less efficient.
  15. Replies
    29
    Views
    2,086

    They take 10 bytes each. That means, any...

    They take 10 bytes each. That means, any meaningful table would eat a huge amount of resources. f.e., a sin table with 0.01 precision would take (PI * 2 / 0.01) * 10 = about 6 kilobytes. Also apply...
  16. Replies
    21
    Views
    2,067

    I wish I lived in the US. That looks more than...

    I wish I lived in the US. That looks more than spectacular. I love Nintendo. They are one of the best game companies IMO.
  17. Replies
    36
    Views
    2,926

    ...yet. New questions have always existed, it's...

    ...yet. New questions have always existed, it's just a matter of solving them.
  18. Replies
    19
    Views
    2,382

    Really hate those paranoid economists. They...

    Really hate those paranoid economists. They damage themselves with this nonsense more than they gain. And all customers / crackers, too.

    Maybe if they started producing more games that are...
  19. Replies
    36
    Views
    2,926

    Hmm... seems quite right. But really, some things...

    Hmm... seems quite right. But really, some things just are without us knowing why.



    Einstein stated that E=mc. Every object carries energy related to its mass. Nice idea.

    Then some other...
  20. Replies
    6
    Views
    1,115

    I doubt that will help. Assert is also a very...

    I doubt that will help. Assert is also a very good tool, but it will be difficult to impossible to unit test with assert unless you hard-code your tests there.
  21. Replies
    14
    Views
    13,742

    If you declare it an array, the compiler...

    If you declare it an array, the compiler automatically knows its size.
  22. Replies
    36
    Views
    2,926

    Negative energy doesn't mean negative mass if you...

    Negative energy doesn't mean negative mass if you meant that. It should be the absolute value of the mass.

    Altho I'm not sure about that asymmetry. Wasn't it that certain things just were...
  23. Replies
    14
    Views
    13,742

    It's also possible to declare text_base as an...

    It's also possible to declare text_base as an array and use sizeof text_base.
  24. Replies
    36
    Views
    2,926

    Right. Although that is something I have never...

    Right. Although that is something I have never fully grasped...
  25. Replies
    36
    Views
    2,926

    Actually, it should be E=(mc) which turns out...

    Actually, it should be E=(mc) which turns out to be E=[+-]mc.


    I hope the recent CERN experiment will take us further. We are about the same level on quantum mechanics as decades ago.
Results 1 to 25 of 493
Page 1 of 20 1 2 3 4