Search:

Type: Posts; User: ForzaItalia2006

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    893

    If you have no real idea how the compiler handles...

    If you have no real idea how the compiler handles these expression, why don't you try a little testprogram and let the compiler do the work for you :-)



    #include <stdio.h>

    int main ()
    {...
  2. Replies
    13
    Views
    5,635

    Okay, I agree. You're right :-)

    Okay, I agree. You're right :-)
  3. Replies
    13
    Views
    5,635

    Why? Sure, it's a possibly harder to read, but...

    Why? Sure, it's a possibly harder to read, but formally correct :-)
  4. Replies
    13
    Views
    5,635

    That's great to hear that it worked :-) Sure, I...

    That's great to hear that it worked :-) Sure, I could give some kind of background about this.

    Whenever you pass a parameter to a function, this parameter is passed by-value, meaning that its...
  5. Replies
    13
    Views
    5,635

    Hey, first of all, in C you _NEVER_ call by...

    Hey,

    first of all, in C you _NEVER_ call by reference. C only allows to call-by-value. Call-by-reference is an enhancement in C++.

    This is how your code should work:



    #include <stdio.h>...
  6. Check out this link Simple DirectMedia Layer...

    Check out this link Simple DirectMedia Layer (SDL library)
  7. Hey, when saying that you use a mutex, do you...

    Hey,

    when saying that you use a mutex, do you mean the mutex associated with the condition variable or do you use an additional mutex.

    According to the POSIX standard, pthread_cond_signal...
  8. Replies
    12
    Views
    2,210

    Hey, There are some issues with your code and...

    Hey,

    There are some issues with your code and I would recommend to also read a book about algorithms, especially sorting algorithms, because that what you do has nothing to do with sorting an...
  9. Replies
    5
    Views
    1,331

    Hey, I assume you're working on a Windows box?...

    Hey,

    I assume you're working on a Windows box?

    Please read this FAQ entry: Cprogramming.com FAQ > Stop my Windows Console from disappearing everytime I run my program?

    - Andi -
  10. Replies
    15
    Views
    13,963

    Yes, you execute two separate commands, just like...

    Yes, you execute two separate commands, just like a shell would do. But, you connect both programs by the pipe. Though, to clarify what salem already explained:

    ls -- write --> | PIPE | -- read...
  11. Replies
    15
    Views
    13,963

    Hey, once the exec*(2) call is successful,...

    Hey,

    once the exec*(2) call is successful, exec*(2) won't return to your "original" program.

    To realize the command "ls | wc", you could fork(2) two processes and connect them by a pipe(2) and...
  12. Replies
    6
    Views
    1,466

    I shortly hesitated to list that example, but I...

    I shortly hesitated to list that example, but I completely feared the reactions :p
  13. Replies
    6
    Views
    1,466

    By using loops whose loop-counter corresponds to...

    By using loops whose loop-counter corresponds to your input. As said above, if you use a loop to print the characters you will print 5 characters if the user's input was 5, and 10 accordingly if the...
  14. Replies
    2
    Views
    2,821

    Instead of requesting a complete algorithm (with...

    Instead of requesting a complete algorithm (with exclamation mark), you should have used Dr. Google with "TREE QUICKSORTING with MPI"!!! The first hit shows an example of a quicksort MPI...
  15. Replies
    11
    Views
    1,423

    Yes, you're indeed right. I originally thought...

    Yes, you're indeed right. I originally thought this should work (especially when working with pointers), but I got a compiler error that an lvalue is required. But I must admit, that I was to fast...
  16. Replies
    11
    Views
    1,423

    That's the first one where you have to manually...

    That's the first one where you have to manually copy the '\0' into destination[i] after the loop.



    Yes, that works as well, but only if destination is declared as "char *". If you declare...
  17. Replies
    1
    Views
    1,186

    PRIVATE is not a C keyword. To make a function...

    PRIVATE is not a C keyword. To make a function private you need to use the static keyword. So, maybe you are missing a

    #define PRIVATE static?

    Or, you should just replace PRIVATE by static ......
  18. Replies
    1
    Views
    2,147

    Hey, the C compiler always binds the "else" to...

    Hey,

    the C compiler always binds the "else" to the inner-most if, so that your else is not bound to the "if (direction == 1)". Your indention however easily leads to the assumption that your code...
Results 1 to 18 of 18