Here are the children
dectohex.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <string.h>
Type: Posts; User: BMathis
Here are the children
dectohex.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <string.h>
#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...
would it make more sense for the child to be using read() to read in from the pipe rather than fgets()
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...
while(fgets(input, sizeof(input), stdin)!=NULL){
if(strchr(input, EOF)) break;
else printf("Child got: %s", input);
}
seems to work so far
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...
Like, I literally want to send ctrl D through the pipe to the child.
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?
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...
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 ...
parent.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <string.h>
/*
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){...
char str[32];
int x=256;
sprintf(str, "%d", x);
gives: str=0
is there any way around this?
Solved problem, thx guys
still got the same error
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...
But where is the fun in that :P
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...
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...
/************************************************
**Brandon Mathis
**Add.cpp v1
**11 Feb 2007
************************************************/
#include <stdio.h>
#include <cstdlib>
#include...