Search:

Type: Posts; User: BMathis

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    3,065

    Here are the children dectohex.c #include...

    Here are the children

    dectohex.c


    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <sys/types.h>
    #include <string.h>
  2. Replies
    1
    Views
    3,065

    cont of IPC using PIPE

    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <sys/types.h>
    #include <string.h>

    /*
    *Decimal number is taken in through standard input and
    *output to a file called...
  3. Replies
    28
    Views
    4,940

    would it make more sense for the child to be...

    would it make more sense for the child to be using read() to read in from the pipe rather than fgets()
  4. Replies
    28
    Views
    4,940

    That is originally what I wanted to do. In my...

    That is originally what I wanted to do. In my parent I
    close(commpipe[1]);
    when I am done writing into the pipe. Is that EOF sent through the pipe just before it is closed?
    If that is the case, my...
  5. Replies
    28
    Views
    4,940

    while(fgets(input, sizeof(input), stdin)!=NULL){...

    while(fgets(input, sizeof(input), stdin)!=NULL){
    if(strchr(input, EOF)) break;
    else printf("Child got: %s", input);
    }


    seems to work so far
  6. Replies
    28
    Views
    4,940

    That seems as though it would work but my child...

    That seems as though it would work but my child program just spits out "Child got:?" and sits there waiting for more stuff to read through the pipe.

    For some reason it is seeing that EOF as...
  7. Replies
    28
    Views
    4,940

    Like, I literally want to send ctrl D through the...

    Like, I literally want to send ctrl D through the pipe to the child.
  8. Replies
    28
    Views
    4,940

    I know this is stupid but HOW do i send the EOF?...

    I know this is stupid but HOW do i send the EOF? Can i send it through the stdout using printf() and if so, how?
  9. Replies
    28
    Views
    4,940

    This cant work because the child would end upon...

    This cant work because the child would end upon encountering something other than ctrl D.

    If the child is run by itself then the user should be able to type words indefinitely until he or she hits...
  10. Replies
    28
    Views
    4,940

    I do not want to send the child flags by having...

    I do not want to send the child flags by having to type "END" or something similar at the end of every file. That does not achieve what I am trying to get.




    Am I not doing that with the ...
  11. Replies
    28
    Views
    4,940

    IPC using PIPES

    parent.c


    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <sys/types.h>
    #include <string.h>

    /*
  12. Thread: sprintf()

    by BMathis
    Replies
    2
    Views
    1,336

    sorry, I was using a child process to pass the...

    sorry, I was using a child process to pass the value of x back into a coordinator process and it seems that exit() can not handle integers above 256..... i think?


    pid=fork();
    if(pid==-1){...
  13. Thread: sprintf()

    by BMathis
    Replies
    2
    Views
    1,336

    sprintf()

    char str[32];
    int x=256;
    sprintf(str, "%d", x);


    gives: str=0
    is there any way around this?
  14. Replies
    7
    Views
    7,290

    Solved problem, thx guys

    Solved problem, thx guys
  15. Replies
    7
    Views
    7,290

    still got the same error

    still got the same error
  16. Replies
    7
    Views
    7,290

    I think the problem lies in my actual use of...

    I think the problem lies in my actual use of pointers or some misunderstanding of pointers that I may have. If anyone needs any clarification on the problem please let me know. I have a sinking...
  17. Thread: Day countdown

    by BMathis
    Replies
    5
    Views
    3,209

    But where is the fun in that :P

    But where is the fun in that :P
  18. Thread: Day countdown

    by BMathis
    Replies
    5
    Views
    3,209

    Nostalgia

    Ahh, this is one of the first programs I ever wrote.

    Should be as simple as subtracting the days between the two dates if the months are equal to one another.
    Here are some snags you need to...
  19. Replies
    7
    Views
    7,290

    Code in initial post changed to reflect...

    Code in initial post changed to reflect suggestion.

    Yea, I also thought that was the problem initially but it still did not fix the bug. If I call Addworker myself from the command line and feed...
  20. Replies
    7
    Views
    7,290

    Passing values through execlp()

    /************************************************
    **Brandon Mathis
    **Add.cpp v1
    **11 Feb 2007
    ************************************************/
    #include <stdio.h>
    #include <cstdlib>
    #include...
Results 1 to 20 of 20