Search:

Type: Posts; User: karumudi7

Search: Search took 0.00 seconds.

  1. why do we need last for loop at that place? Isn't...

    why do we need last for loop at that place? Isn't it, the forks are completed by the time?



    for (int i = 0; i < K; i++)
    wait(NULL);
  2. Replies
    2
    Views
    5,168

    Thanks for the advice. In my current job we...

    Thanks for the advice.
    In my current job we generally don't use C/C++ and I am in a Solution Architect position... so no one in my work expects me to work on programming :(
  3. Replies
    2
    Views
    5,168

    Latest C/C++ learning resources

    Hello,

    I have seen there is a sticky post on this, but it looks closed and last updated was some years ago, just thought to see if there are any new resources avaialble where I can learn C/C++?...
  4. Thanks for the hack! I ran this on my computer...

    Thanks for the hack! I ran this on my computer and as you said it is giving the desired output.
    And Yes, I agree that array will be overwritten, that's what I thought first and then I thought,...
  5. Here is the complete snippet. Sorry for...

    Here is the complete snippet. Sorry for confusion. I am trying to receive the second one, but nothing is coming.








    //---------------- sender.c
  6. I just figured that msg = msgs[front] Yes...

    I just figured that
    msg = msgs[front]

    Yes it is mine, it is having some unnecessary stuff and dont want to confuse.

    With that correction, I see first message is printing now but second...
  7. Here are my code files (prototypes)... My project...

    Here are my code files (prototypes)... My project will compile first with all the files and on boot up, the main.c will start executes.




    //------- main.c
    #include <SOME global header.h that...
  8. I am not that familiar with structs, so trying in...

    I am not that familiar with structs, so trying in this way. I removed the header and declared and initialized the variables in sender.c and in receiver.c I am using as extern.
    But the output is...
  9. I changed to Arrays, but I am getting multiple...

    I changed to Arrays, but I am getting multiple error messages when compiling the project:

    multiple definition of rear, front, size, CAPACITY



    //mulmessgs.h


    int CAPACITY = 10;
  10. I don't need any dynamic allocations, just a...

    I don't need any dynamic allocations, just a simple queue that store say 5 messages. I never used malloc though, it was a reference. Any other ways to get this functionality, like an array?
  11. Queue operations giving undefined reference to malloc

    Hello,

    I am trying to implement a message storage (string type) and retrieval functionality, where I have 3 c files:

    main.c
    sender.c --> this will have send function
    receiver.c --> this...
  12. Thanks much! I have update mine also to put...

    Thanks much! I have update mine also to put fork() inside for loop and getting individual outputs. But stuck with pipes to send the outputs, this is because, I have never worked with pipes before. If...
  13. How to get single output from different forks

    Hello, I am trying to write a program with multiple forks, but trying to figure out how to show as single output from all the Childs. In this case, just show total number of primes calculated from...
Results 1 to 13 of 13