Search:

Type: Posts; User: flp1969

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. 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 );
  2. 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.
  3. 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
  4. 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 -...
  5. Replies
    8
    Views
    252

    I believe the listing is self explanatory.

    I believe the listing is self explanatory.
  6. Replies
    8
    Views
    252

    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 ...
  7. Replies
    13
    Views
    310

    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....
  8. Replies
    13
    Views
    310

    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;
  9. Replies
    13
    Views
    310

    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...
  10. 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 );...
  11. Replies
    13
    Views
    310

    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...
  12. Replies
    13
    Views
    310

    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...
  13. Replies
    19
    Views
    510

    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...
  14. Replies
    19
    Views
    446

    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...
  15. Replies
    19
    Views
    446

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

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

    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...
  17. Replies
    19
    Views
    446

    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...
  18. Replies
    19
    Views
    446

    Well... do better then...

    Well... do better then...
  19. Replies
    19
    Views
    446

    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>
  20. Replies
    19
    Views
    446

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

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

    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....
  22. Replies
    6
    Views
    354

    Undefined behavior.

    Undefined behavior.
  23. Replies
    6
    Views
    279

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

    ███████████████████████████████████████
    █████████████▓▒░░░░░░░░▒███████████████
    ███████████▓░░░░░░░░░░░░░▒█████████████
    ██████████▒░░░▓▓░░░░░░░░░░░▓███████████...
  24. Replies
    6
    Views
    279

    One thing to notice on John's code: ... int...

    One thing to notice on John's code:

    ...
    int main()
    {
    int n = 0;
    int guess=0;
    char answer[14];

    srand(time(0));
  25. Replies
    6
    Views
    279

    It is not true if you allocate an array of 14...

    It is not true if you allocate an array of 14 bytes it will ocuppy 14 bytes on stack... It can ocupy from 16 to 32 bytes, depending on optimizations, platform and alignment.

    It is not true that...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4