Search:

Type: Posts; User: Sir Galahad

Page 1 of 6 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    187

    Oh okay. Kind of annoying that a compiler would...

    Oh okay. Kind of annoying that a compiler would support an extension by default though. Code would be way more portable if that sort of thing would raise an error/warning instead.
  2. Replies
    8
    Views
    187

    The code at the bottom is my signature. And both...

    The code at the bottom is my signature. And both compile just fine (tested with gcc and clang on linux).
  3. Replies
    8
    Views
    187

    No? int main(void) { int $ = 0; }

    No?



    int main(void)
    {
    int $ = 0;
    }
  4. Replies
    4
    Views
    175

    Ah, right! It's only UB with signed values...

    Ah, right! It's only UB with signed values...
  5. Replies
    4
    Views
    175

    It's undefined behaviour. Best thing to do is...

    It's undefined behaviour. Best thing to do is check before the subtraction.
  6. Replies
    8
    Views
    259

    Because you're effectively erasing its current...

    Because you're effectively erasing its current value here:



    y=d+=w;
  7. Replies
    4
    Views
    287

    If you don't have control over the output file...

    If you don't have control over the output file then your only real choice is to read it in binary and just do trial and error adjustments to account for alignment, data-widths, endian-ness, and...
  8. Replies
    5
    Views
    198

    You can use strcmp() to compare strings. Here's...

    You can use strcmp() to compare strings. Here's another function that does non-case-sensitive comparisons to test for equality:



    #include <ctype.h>

    int strlike(const char* left, const char*...
  9. Closed source AND highly platform specific? Yeah...

    Closed source AND highly platform specific? Yeah that's a real winner all right...
  10. Replies
    4
    Views
    229

    At this point the whole toolchain is rather just...

    At this point the whole toolchain is rather just a hodge-podge of coexisting technologies. The good news is it's not as bad as you think. You can in fact compile and run a simple C program on just...
  11. Thread: Function

    by Sir Galahad
    Replies
    3
    Views
    159

    Yep. Write a little code, compile and run,...

    Yep. Write a little code, compile and run, inspect the output. Rinse and repeat...
  12. Well exactly. We are all brothers and sisters on...

    Well exactly. We are all brothers and sisters on this Earth. Lacking kindness only serves to suck all of the good out of a person, not to mention the effect it has on others.



    It's weird that...
  13. Replies
    4
    Views
    289

    Well "possibly in set" necessarily implies...

    Well "possibly in set" necessarily implies inexact matching, so no. They just help speed up the whole process by skipping patterns which are "definitely not in set". And also relatively easy on...
  14. And I apologize for implying such a thing, that...

    And I apologize for implying such a thing, that was rather unfair of me.The internet just seems to have developed this cold-hearted culture over the past few years. I really gets to me! Anyway, I was...
  15. Hardly surprising, if you ask me...

    Hardly surprising, if you ask me...
  16. That is true, there would be certain things the...

    That is true, there would be certain things the compiler could do to help optimize things. But as far as being able to determine the exact relationship between all of the different operators, that's...
  17. Replies
    16
    Views
    928

    Looks good. A little cleaner way to implement...

    Looks good. A little cleaner way to implement those operators would be to first code a "compare" function that returns -1, 0, or 1 (ie: less, equal, greater) and then simply define all of the other...
  18. How would a compiler possibly go about optimizing...

    How would a compiler possibly go about optimizing such a thing in the first place, much less some "generic" third party library? You can of course do this in C++, but the solution would likely be...
  19. Replies
    4
    Views
    289

    Sure, let's see what you've got. Have you had a...

    Sure, let's see what you've got. Have you had a chance to look into bloom filters yet? The lookup time-complexity is more or less O(1).
  20. Well a lot of people might just assume that it's...

    Well a lot of people might just assume that it's strictly an algorithmic issue. It helps to understand just how powerful C++ is in that respect.
  21. The C version also has to do all of that pointer...

    The C version also has to do all of that pointer dereferencing, whereas with C++ much of that code can be inlined. So that's going to impact performance too.
  22. A better alternative would be nice, but I guess...

    A better alternative would be nice, but I guess I'm just content enough with what's available. Most popular languages can be used even on the most exotic embedded systems these days.

    Have you...
  23. It's just a simple demonstration of the...

    It's just a simple demonstration of the connection between the "coprimality" of all the integers and the mathematical constant "pi" (ie: 3.1415926[...]). It works even better if you're sampling...
  24. You can also use setjmp/longjmp...

    You can also use setjmp/longjmp, although you do have to be REALLY careful with them (lest your program fall into in an "invalid" state).



    #include<stdio.h>
    #include <setjmp.h>

    jmp_buf...
  25. I have no idea, but I'm guessing most likely not....

    I have no idea, but I'm guessing most likely not. Even though the peasant's algorithm is basically equivalent to long multiplication, the latter is easier to implement. Older CPU's used that method...
Results 1 to 25 of 133
Page 1 of 6 1 2 3 4