Search:

Type: Posts; User: flp1969

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    12
    Views
    327

    BMP file format - Wikipedia...

    BMP file format - Wikipedia
  2. Replies
    1
    Views
    64

    Google or DuckduckGo are your friends. Use...

    Google or DuckduckGo are your friends. Use them...

    ODBC from C Tutorial Part 1
  3. Replies
    12
    Views
    215

    You are aware that any recursive routine can be...

    You are aware that any recursive routine can be made without recursion, right?

    Here's a quicksort without recursion (using an allocated stack):

    #include <stdio.h>
    #include <stdlib.h>
    ...
  4. Replies
    12
    Views
    215

    Do you mind to clarify?

    Do you mind to clarify?
  5. Replies
    12
    Views
    215

    A more "generic" approach: #include ...

    A more "generic" approach:

    #include <stdlib.h>

    // Comparison funcions named after type and identifier.
    #define QSORT_CMP_FN_ASC(T,FN) FN ## _ ## T ## _A
    #define QSORT_CMP_FN_DESC(T,FN) FN ##...
  6. Replies
    12
    Views
    215

    #define INTARRAY_ELEMENTS(a) \ (sizeof a /...

    #define INTARRAY_ELEMENTS(a) \
    (sizeof a / sizeof a[0])

    static int cmp( const void *ap, const void *bp )
    { return (*(int *)ap > *(int *)bp) - ( *(int *)ap < *(int *)bp ); }

    ...
    int...
  7. Replies
    2
    Views
    133

    This is a null expression. The use of (void)...

    This is a null expression. The use of (void) there is an attempt to avoid a compiler warning... Not really necessary (because the expression is null, but valid).
  8. Replies
    3
    Views
    168

    No problems here: $ cc -g -o test test.c $...

    No problems here:

    $ cc -g -o test test.c
    $ echo 'test' > input
    $ gdb test
    Reading symbols from test...done.
    (gdb) r < input
    Starting program ./test < input
    test
    [Inferior 1 (process 8995)...
  9. This is WRONG: int index; while ( ( index...

    This is WRONG:


    int index;

    while ( ( index = strstr( str1, str2 ) ) != NULL ) ...
  10. You could keep 'sum' as integer (with more...

    You could keep 'sum' as integer (with more precision then individual values) and just convert to 'long double' (which have the same precision, in bits, as 'long long') when you calculate the mean:
    ...
  11. Thread: Run a program

    by flp1969
    Replies
    3
    Views
    242

    Hehehe... ;)

    Hehehe... ;)
  12. Replies
    12
    Views
    373

    I really don't get it... Do you realize that a...

    I really don't get it... Do you realize that a "byte" is 8 bits, so, by definition "binary data", don't ya?
  13. Yep, I notice... Since did a good try I thought...

    Yep, I notice... Since did a good try I thought it wasn't that harmul to show a different approach...
  14. Odd numbers between 20 and 100 are between 21...

    Odd numbers between 20 and 100 are between 21 (not 19) and 99:


    #include <stdio.h>

    int main( void )
    {
    int n = 21; // first odd value between 20 and 100.
    int sum = 0;
  15. I strongly recommend that you don't use floating...

    I strongly recommend that you don't use floating point types with currency calculations.

    Because of the nature of floating point implementation, most values aren't exact and due to rounding, some...
  16. As said here before, floating point values are...

    As said here before, floating point values are (often) approximations. Furthermore, they are binary representations of rational values (ℚ domain), not real values (ℝ domain). A decimal value,...
  17. Replies
    1
    Views
    227

    gSOAP (https://www.genivia.com/dev.html)

    gSOAP
  18. Replies
    4
    Views
    291

    Aren't you forgetting about multibyte charsets?

    Aren't you forgetting about multibyte charsets?
  19. int count_digits( char *s ) { int counter =...

    int count_digits( char *s )
    {
    int counter = 0;

    for (; *s; s++ )
    if ( isdigit( *s ) )
    counter++;

    return counter;
    }
  20. Replies
    4
    Views
    397

    From the wiki article: "All of the integer...

    From the wiki article:

    "All of the integer values are stored in little-endian format (i.e. least-significant byte first)."
  21. Replies
    3
    Views
    841

    IF you are using a multibyte charset (UTF-8, for...

    IF you are using a multibyte charset (UTF-8, for example) you should convert this string to wchar_t string and use wcsrchr() instead of strchr():


    /* test.c */
    #include <stdlib.h>
    #include...
  22. Replies
    6
    Views
    404

    Testing I've got a "segmentation fault" here...

    Testing I've got a "segmentation fault" here...
  23. Replies
    4
    Views
    351

    Maybe you'll find this useful: Simple DirectMedia...

    Maybe you'll find this useful: Simple DirectMedia Layer - Homepage
  24. And to add one more to @Salem's list: - never do...

    And to add one more to @Salem's list:
    - never do this:

    input = realloc(input, size);
    If you do and realloc cannot allocate memory, you'll end up with a "memory leakage".

    []s
    Fred
  25. Be aware that CSV files can use double quotes (")...

    Be aware that CSV files can use double quotes (") to specify strings. For example:

    "String, with comma",10,3.14
    So, tokenizing, using ',' as separator must be done with care.
    There are other...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4