Search:

Type: Posts; User: flp1969

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    85

    That's because 'E' is used in floating point...

    That's because 'E' is used in floating point literals. The compiler thinks 0xE+1 is nnnE+1 as in 3.14e+1 literal. Try to use (0xE)+1 instead.
  2. Unfortunately, this doesn't work on Windows....

    Unfortunately, this doesn't work on Windows. Here's the same code, using fopen() (test.exe) and _wfopen() (test2.exe). Notice that in file explorer the created flie is shown with the "correct" name...
  3. The test code is simply: if ( ! ( f = _wfopen(...

    The test code is simply:

    if ( ! ( f = _wfopen( L"履歴書.txt", L"w,ccs=UTF-8" ) ) )
    { perror( "_wfopen" ); exit(1); }
    fclose( f );
  4. Sorry... it is not a code, but an image of file...

    Sorry... it is not a code, but an image of file explorer, showing the name correctly.
    I'am getting ???.txt on terminal, but on file explorer is correct.
  5. Here worked fine. The problem, it seems, is the...

    Here worked fine. The problem, it seems, is the Windows terminal don't recognize UNICODE:

    16219
  6. ISO 9899 accepts limited sets of multibyte...

    ISO 9899 accepts limited sets of multibyte charsets like UNICODE, as defined in Annex D of the standard. Including using multibyte charset with identifiers (thou some compilers don't respect this -...
  7. Replies
    8
    Views
    262

    I believe the listing is self explanatory.

    I believe the listing is self explanatory.
  8. Replies
    8
    Views
    262

    Use GIMP and Export to C file. Example (I want to...

    Use GIMP and Export to C file. Example (I want to believe X-Files poster):

    /* GIMP RGB C-Source image dump (believe.c) */

    static const struct {
    unsigned int width;
    unsigned int ...
  9. Replies
    13
    Views
    312

    Sorry... I realize now my examples are stacks,...

    Sorry... I realize now my examples are stacks, not queues... When 'poping' get the first element and copy the rest of them to the beggining, changing the size of the buffer to less one element....
  10. Replies
    13
    Views
    312

    Not THE way to go... You could use dynamic...

    Not THE way to go... You could use dynamic arrays:


    int *queue = NULL;
    size_t elements = 0;

    int push( int x )
    {
    int *p;
  11. Replies
    13
    Views
    312

    In this case, yes, you can. [ I prefer to...

    In this case, yes, you can.
    [
    I prefer to declare all my local objects in the beggining of the function, in rare cases I use a block declaration (when I want to reuse the identifier in different...
  12. Replies
    5
    Views
    200

    Useful macros: #define BITSET(v,b) { (v) |=...

    Useful macros:

    #define BITSET(v,b) { (v) |= (1U << (b)); }
    #define BITRESET(v,b) { (v) &= ~(1U << (b)); }
    #define BITINVERT(v,b) { (v) ^= (1U << (b)); }

    /* Example: */
    BITRESET( PCA0MD, 6 );...
  13. Replies
    13
    Views
    312

    I don't, but in this case I did hope it looks...

    I don't, but in this case I did hope it looks like an "opaque" type, like FILE...


    If create_queue() fails, it'll return NULL. I prefer to check for error from the calling function. This way I...
  14. Replies
    13
    Views
    312

    I would prefer to allocate the nodes outside the...

    I would prefer to allocate the nodes outside the push/pop functions. And to do a more "generic" queue, like this:

    #include <stdio.h>
    #include <stdlib.h>

    // Generic node structure.
    // Use...
  15. Replies
    19
    Views
    512

    And, again, it makes no sense. What is being done...

    And, again, it makes no sense. What is being done with this "address counter"? Is it a "program counter" or "instruction pointer"? In that case this "add %ac,%1" is nothing else but an indirect jump...
  16. Replies
    19
    Views
    447

    The suggestion of avoiding branches is a good...

    The suggestion of avoiding branches is a good one. But not at the cost of using an "instruction" slower then a possible penalty of a single clock cycle if the conditional branch is not taken, due to...
  17. Replies
    19
    Views
    447

    Of course, more 'e's than 'u's in english. Stuff...

    Of course, more 'e's than 'u's in english. Stuff like that? :)
  18. Replies
    19
    Views
    512

    It's not that is "incorrect", but using a bitwise...

    It's not that is "incorrect", but using a bitwise OR that way he's forcing to every single expression to be evaluated, breaking the "short circuit" just to avoid some conditional branches. AND, if...
  19. Replies
    19
    Views
    447

    Thanks, there is room to improvement yet. To...

    Thanks, there is room to improvement yet.

    To avoid that "branch" I could've done something like this:

    c += is_consonant( *p );
    v += is_vowel( *p );
    But we'll gain, if something, just about a...
  20. Replies
    19
    Views
    447

    Well... do better then...

    Well... do better then...
  21. Replies
    19
    Views
    447

    Ok... here it is my version: #include...

    Ok... here it is my version:

    #include <stdio.h>
    #include <unistd.h>
    #include <fcntl.h>
    #include <stdlib.h>
    #include <sys/time.h>

    #ifdef DEBUG
    # include <inttypes.h>
  22. Replies
    19
    Views
    447

    PS: Improved the code a little more... now it is...

    PS: Improved the code a little more... now it is 10x faster.
  23. Replies
    19
    Views
    447

    My best shot, so far. The 'original' is the...

    My best shot, so far.

    The 'original' is the code above. 'count' is mine. Pure C, portable (I think)...

    I'll post when you post yours! :)


    $ ./original; echo; ./count
    Cycles: 223980894....
  24. Replies
    6
    Views
    355

    Undefined behavior.

    Undefined behavior.
  25. Replies
    6
    Views
    280

    ███████████████████████████████████████...

    ███████████████████████████████████████
    █████████████▓▒░░░░░░░░▒███████████████
    ███████████▓░░░░░░░░░░░░░▒█████████████
    ██████████▒░░░▓▓░░░░░░░░░░░▓███████████...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4