Search:

Type: Posts; User: flp1969

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    54

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

    Testing I've got a "segmentation fault" here...
  2. Replies
    4
    Views
    191

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

    Maybe you'll find this useful: Simple DirectMedia Layer - Homepage
  3. 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
  4. 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...
  5. Replies
    4
    Views
    122

    Another one: printf() should have the format...

    Another one: printf() should have the format string in line 5, as in:

    printf( "%s", argv[1] );
  6. Replies
    4
    Views
    122

    Problems with this code: 1. your buffer (code)...

    Problems with this code:
    1. your buffer (code) has obly 10 chars (as you notice) and 11 bytes are being copied;
    2 '9' (value: 57) is not the same thing as 9;
    3. argv[1] could have less then 10...
  7. Replies
    11
    Views
    322

    fwrite() doesn't work for you?

    fwrite() doesn't work for you?
  8. Replies
    10
    Views
    160

    @Ramsis94, get the GNU C Library manual...

    @Ramsis94, get the GNU C Library manual and take a look at printf() funcion at 12.12.7 (page 277):

    16043

    Notice the "AS-Unsafe" at "Preliminary". This means, printf() isn't safe to use in...
  9. Replies
    10
    Views
    160

    And... avoid to use signal()... it is outdated....

    And... avoid to use signal()... it is outdated.
    Use sigaction().
  10. Read about fscanf().

    Read about fscanf().
  11. Linux ou outro Unix? man 7 signal, veja...

    Linux ou outro Unix?

    man 7 signal, veja SIGPIPE.
  12. Replies
    7
    Views
    223

    Well... Bit inversion is missing: x ^= (1

    Well... Bit inversion is missing:


    x ^= (1 << bit);
  13. Replies
    2
    Views
    120

    In the example, foo is set to 1 and the while...

    In the example, foo is set to 1 and the while loop never ends.
  14. Thread: DataType in C

    by flp1969
    Replies
    8
    Views
    207

    Did you paid attention to the compiler WARNINGS?

    Did you paid attention to the compiler WARNINGS?
  15. Replies
    7
    Views
    223

    Like Zeus_ said... Here's a detailed explanation....

    Like Zeus_ said... Here's a detailed explanation.

    When testing for true or false, any value different from 0 is TRUE. 0 is always FALSE. This expression will isolate bit i of the value from...
  16. Replies
    7
    Views
    259

    Then, it is not possible with your code... result...

    Then, it is not possible with your code... result will have to point to a buffer which requires 2^64 bytes ( 1 EiB ).
  17. You'll need a third loop for a variable square...

    You'll need a third loop for a variable square matrix dimensions...
  18. This way? void m4x4_mult( double *m, double...

    This way?

    void m4x4_mult( double *m, double *n, double *r )
    {
    int i, j;

    for ( i = 0; i < 4; i++ )
    for ( j = 0; j < 4; j++ )
    {
    r[i+4*j] = m[4*j] * n[i] +
  19. Replies
    2
    Views
    166

    Take a look at Gaussian Blur...

    Take a look at Gaussian Blur. Maybe this is what you are looking for.
  20. Replies
    4
    Views
    347

    It is allowed, as an extension, using GCC... But,...

    It is allowed, as an extension, using GCC... But, of couse, it is not advisable:

    #include <stdio.h>

    int main( void )
    {
    void show( void ) { puts( "Hello" ); }

    show();
    }
  21. Replies
    2
    Views
    185

    To understand your question: You want to pick an...

    To understand your question: You want to pick an item randomly and place it before the greater value from the beginning of the array? That's it?
    Or... Do you want to sort the entire array? In that...
  22. Replies
    4
    Views
    212

    Precision: float has 24 bits of precision, double...

    Precision: float has 24 bits of precision, double has 53 bits of precision, long double has 64 bits of precision.

    Anyway... your printf format argument is wrong, it should be "%f". "%Lf"...
  23. Not only a matter of style. This: int f() {...

    Not only a matter of style. This:

    int f() { return 2; }
    is different than this:

    int f(void) { return 2; }
    Since if you call the first with:

    y=f(1,2,"abc", 3.14, NULL);
    Your compiler...
  24. Replies
    6
    Views
    528

    80 bits, with 64 bits precision. 'long double'...

    80 bits, with 64 bits precision. 'long double' tends to occupy 16 bytes on memory due to alignment.

    There is an extension on GCC (and, I believe, clang): __float128 (128 bits, 113 bits precision).
  25. Replies
    2
    Views
    124

    Since Ackerman recursion cannot be called with...

    Since Ackerman recursion cannot be called with negative values:

    unsigned int ackermann(unsigned int m, unsigned int n)
    {
    if (!m) return n + 1;
    if (!n) return ackermann(m - 1, 1);
    return...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4