Search:

Type: Posts; User: flp1969

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds; generated 29 minute(s) ago.

  1. Replies
    2
    Views
    64

    Something like this? static void...

    Something like this?

    static void do_nothing(int sig) {}
    ...
    signal( SIGALRM, do_nothing );

    alarm(3);
    errno = 0;
    write( ... );
    if ( errno == EINTR ) puts( "timedout" );
  2. You need to read the documentation, write some...

    You need to read the documentation, write some code, link with the libraries and voilą!
  3. For Linux/FreeBSD I recomend ALSA and ffmpeg (lav...

    For Linux/FreeBSD I recomend ALSA and ffmpeg (lav libraries)... You can try to use SDL sound libraries as well...
  4. Replies
    11
    Views
    196

    One little thing, thou... this: #include...

    One little thing, thou... this:

    #include <stdio.h>

    int main( void )
    {
    int number = -987;
    int reverse = 0;

    while ( number > 0 )
  5. Trivial, but your code has several errors...

    Trivial, but your code has several errors (exemple: shifting a signed integer left) and since this is a C language programming forum, it is completely wrong...

    Here's a more direct way to convert...
  6. Replies
    5
    Views
    133

    Pendulum...

    Pendulum
  7. As Salem told you, this code is an old code for...

    As Salem told you, this code is an old code for MS-DOS and won't work on WINDOWS!
  8. The compiled final code isn't just YOUR code....

    The compiled final code isn't just YOUR code. There is an initialization and finalization codes as well. This 'initialization' code calls main(), in console applications, but Windows calls WinMain()...
  9. Replies
    1
    Views
    84

    Nope: #define clear_bit( v, bit ) ( (v) &...

    Nope:


    #define clear_bit( v, bit ) ( (v) & ~(1U << (bit)) )
    #define set_bit( v, bit ) ( (v) | (1U << (bit)) )
    #define toggle_bit( v, bit ) ( (v) ^ (1U << (bit)) )
  10. rename(3) - Linux manpage...

    rename(3) - Linux manpage
  11. manpages and gdb are your friends... use them...

    manpages and gdb are your friends... use them...
  12. Replies
    4
    Views
    139

    Or, declare a pointer to a function and...

    Or, declare a pointer to a function and initialize this pointer to the static function:


    /* module1.c */
    static int f( int x ) { return x + x; } // visible to this module only;
    int...
  13. Replies
    1
    Views
    109

    1- A pointer variable holds an address which...

    1- A pointer variable holds an address which points to a single memory location. malloc() alocates (reserves) a block of memory and returns the address of the first byte;

    2- Yes... The NULL...
  14. Replies
    15
    Views
    347

    Nope... 'ą' is UTF+00E0 and 0xE0 is 224, not 133....

    Nope... 'ą' is UTF+00E0 and 0xE0 is 224, not 133. What you are asking for is the code of 'ą' using WINDOWS-1252 (probably) codepage (or a variation of ISO-8859-1 or Latin-1).
  15. Did you search on MSDN? Here's an example (not...

    Did you search on MSDN? Here's an example (not quite what you want, but it is a start): Capturing an image
  16. My view of pointers and memory: In a very...

    My view of pointers and memory:

    In a very simple way, when you declare a variable you are asking the compiler to reserve enough space to hold the value in the size of that type. So, "int x;", a...
  17. Replies
    43
    Views
    774

    for ( i = 0; i < sizeof lotto / sizeof lotto[0];...

    for ( i = 0; i < sizeof lotto / sizeof lotto[0]; i++)
    printf( "%d ", lotto[i] );
    putchar('\n');
  18. Replies
    43
    Views
    774

    Ahhhhh.... I keep forgeting about distribution....

    Ahhhhh.... I keep forgeting about distribution. Thanks. Those values are very clear to me now!
  19. Replies
    43
    Views
    774

    How did you got this values? Ok... usually rand()...

    How did you got this values? Ok... usually rand() implement LCG, that is less random in the lower bits, but being agnostic about the algorithm, I don't see why a random 32 bits value can generate...
  20. If you have an integer type and divide by 2,...

    If you have an integer type and divide by 2, you'll get an integer value (even if this value is converted, later, to a floating point type), so:

    sqt = p/2;
    will always result in an integer. The...
  21. Replies
    5
    Views
    223

    One tip not related to your problem: Don't use...

    One tip not related to your problem: Don't use 'system("cls");'. It is DOS/Windows specific and dangerous (what if someone put a cls.exe in the directory with a virus?)...

    Here's a clearscreen.c...
  22. And you want to know how to do this using C...

    And you want to know how to do this using C language?
  23. Replies
    6
    Views
    174

    Me too... I prefer to allocate the buffer myself,...

    Me too... I prefer to allocate the buffer myself, in the heap, and keep the stack as short as possible.
  24. Replies
    5
    Views
    175

    Your code, changed a little: #include...

    Your code, changed a little:

    #include <stdio.h>
    #include <stdlib.h> // EXIT_SUCCESS and EXIT_FAILURE are defined here.

    int main ( void )
    {
    size_t i, size;
    int largest;
  25. Replies
    6
    Views
    174

    Again, defining an array of variable length using...

    Again, defining an array of variable length using an uninitialized 'size' is WRONG.
    And the warnings are correct.
Results 1 to 25 of 499
Page 1 of 20 1 2 3 4