Search:

Type: Posts; User: flp1969

Page 1 of 20 1 2 3 4

Search: Search took 0.14 seconds.

  1. Replies
    24
    Views
    7,116

    Aren't you forgetting about charsets? On SysV...

    Aren't you forgetting about charsets? On SysV systems is common the use of UTF-8, so a filename like ":D.txt" is a valid name. It works, including, on Windows (where a modified version of UTF-16 is...
  2. Replies
    4
    Views
    3,133

    # Makefile CFLAGS=-Wall main: segment.o...

    # Makefile

    CFLAGS=-Wall
    main: segment.o memory.o (more objects)

    # Implicit rules
    segment.o: segment.c segment.h memory.h
    memory.o: memory.c memory.h
  3. Replies
    24
    Views
    7,116

    strspn() and strcspn() counts how many chars of a...

    strspn() and strcspn() counts how many chars of a set are or aren't in the original string since it's beginning:


    size_t sz = strspn( "#!#abc", "#!" ); // will return 3 because '#' and '!' are...
  4. Not MIPS...

    Not MIPS...
  5. Replies
    13
    Views
    4,675

    static here have a different meaning. For...

    static here have a different meaning. For functions it means the identifier fun won't be exported (the function is local to the module).

    main and foo are exported (made extern).

    In this...
  6. Replies
    13
    Views
    4,675

    This is not true. Non static local variables can...

    This is not true. Non static local variables can be located on the stack, but the compiler tries to keep them in registers, unless NO optiomizations are used...
  7. Replies
    3
    Views
    3,179

    WS_OVERLAPPEDWINDOW applies to CreateWindowA() or...

    WS_OVERLAPPEDWINDOW applies to CreateWindowA() or CreateWindowExA() function, not to Window Class.
    Read the reference at msdn.
  8. Replies
    12
    Views
    5,856

    Here's the usual "Hello, World" example for Win32...

    Here's the usual "Hello, World" example for Win32 GUI:

    /* main.c */
    #include <windows.h>

    /* Windows procedure (will deal with the messages) */
    LRESULT CALLBACK WndProc(HWND, UINT, WPARAM,...
  9. Replies
    12
    Views
    5,856

    I don't know any modern good books about Win32...

    I don't know any modern good books about Win32 GUI programming. I recommend an old one: Charles Petzold's Windows Programming (for Windows 95 or an older one: for Windows 3.1 - really outdated, but...
  10. #include #include #include...

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

    int main( void )
    {
    char ptr1[] = "abcde";
    char *ptr2 = malloc ( sizeof ptr1 );

    strcpy ( ptr2, ptr1 );
  11. Replies
    4
    Views
    1,652

    That's not the definition of Root Mean Square...

    That's not the definition of Root Mean Square (RMS). This is:
    16641
    Something like this:


    float rms( float *p, unsigned int samples )
    {
    double sum;
    float *q;
  12. I was thinking about "Turbo C (2.01) Compiler"...

    I was thinking about "Turbo C (2.01) Compiler" here! :)
  13. Replies
    52
    Views
    9,339

    Did you guys tried the classical recursive...

    Did you guys tried the classical recursive solver?

    /* sudoku.c */
    #include <stdio.h>
    #include <stdlib.h>

    static _Bool solve ( unsigned int [][9] );

    int main ( void )
    {
  14. atoi won't convert single digits.

    atoi won't convert single digits.
  15. Replies
    14
    Views
    2,252

    Well... just a tip unrelated: This is WRONG: ...

    Well... just a tip unrelated: This is WRONG:


    for ( int j = 0, i = 0; text[i]; i++, j = (j + 1) % plen )
    encrypted[i] = text[i] ^ pword[j];
    encrypted[len] = '\0';

    What will happen if text...
  16. Thread: somthing funky

    by flp1969
    Replies
    7
    Views
    1,631

    If you start to think in terms of functions AND...

    If you start to think in terms of functions AND pointers this could be proven easier:


    #include <stddef.h>
    #include <stdint.h>

    // Both dest and src points to buffers with the same size.
    void...
  17. Thread: somthing funky

    by flp1969
    Replies
    7
    Views
    1,631

    And it is pretty obvious why it doesn't work...

    And it is pretty obvious why it doesn't work...
  18. You should compare with

    You should compare with <= 1 in Factorial routine because 0!=1. And number must be >=0.
    double has 53 bits of precision, while unsigned long long int has 64. This means while double will hold the...
  19. #include #include #include...

    #include <stdio.h>
    #include <stdarg.h>
    #include <stdlib.h>
    #include <string.h>
    #include <limits.h>

    // asprintf() and vasprintf() exists on glibc, but we can make our own,
    // to match ISO 9899...
  20. Replies
    5
    Views
    900

    Simplier: int cmp_( const void *a, const...

    Simplier:


    int cmp_( const void *a, const void *b )
    { const int *p, *q; p = a; q = b; return (*p > *q ) - ( *p < *q ); }
    ...
    int a[] = { ... };
    int *p;
    int key = N;
  21. Replies
    7
    Views
    1,466

    Yep... john.c is right. Actualy, the equation to...

    Yep... john.c is right. Actualy, the equation to calculate the number of decimal algarisms from F(n) is:

    16622

    Take a look:


    #include <stdio.h>
    #include <stdlib.h>
    #include <gmp.h>
  22. Replies
    7
    Views
    1,466

    Use libgmp if you want to deal with big...

    Use libgmp if you want to deal with big numbers...

    And, since:
    16619
    It's easy to demonstrate that a nth Fibonaacci number N(n) algarisms given by:
    16621
    PS: The previous equation to N() was...
  23. Replies
    7
    Views
    1,733

    CSV format standard (RFC 4180) says these are...

    CSV format standard (RFC 4180) says these are valid and are the same thing:

    "aaa","bbb","ccc"<crlf>
    aaa","bbb","ccc<crlf>

    And the " char is done by double quotes:

    10,"abc""d","fred""<crlf>...
  24. Replies
    7
    Views
    1,733

    if your libc supports ISO 27431-2:2010...

    if your libc supports ISO 27431-2:2010 (__STDC_WANT_LIB_EXT2__), then you can use getline() function which will allocate the buffer dynamically.

    Most glibc supports this.
  25. Replies
    9
    Views
    1,707

    If you declare a local array and initialize it,...

    If you declare a local array and initialize it, this initialization is done at runtime, unless the object is declared as static.

    If you declare the local object as static it'll be shared with any...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4