Ahhhhhh, thanks! I was trying to use the same pipe[2] for multiple processes. After the second, it would always dump out to stdout.
Oh, good idea!
Type: Posts; User: Paul22000
Ahhhhhh, thanks! I was trying to use the same pipe[2] for multiple processes. After the second, it would always dump out to stdout.
Oh, good idea!
We are. That is the assignment. (:
I'm posting on my phone. I am not home. I can not program on my phone.
If you can direct me towards a compiler for the G1 phone, I surely would :)
Anyway, you're obviously getting upset by this thread for some odd reason. Please I would appreciate it if you would...
Unfortunately, I won't be able to test this for a while due to the way my class is set up.
A simple yes or no as to if it will overwrite would be much appreciated. I understand if you don't want...
Not unlimited obviously, but I need to run this in a loop. The simple example is something like ls | wc | grep but my professor will test with an undetermined amount of commands, so it has to be...
Check out the picture I posted. I already have the case with 2 processes working. To make it simple, the problem is what do I put for the red text in the picture?
Hi
I am creating a program that can support piping between any number of processes. For 2 processes, you create 1 pipe, and use it between them.
However, for 3 or more pipes, this method will...
I wrote this incorrectly
Gotcha. Thanks. At first I thought it had to be something specific (the program name without the path), so I was just baffled as to why it worked with anything. Makes sense now!
Ohhhh, I see. So really the only time that this ever matters is if the program you call, somehow needs/uses arg0? (Or more specifically, if the program you call needs to know its own name for some...
I added line numbers to your code:
while(!IsEmptyStack(pT)){
x = popStack(&pT);
insertQ(&pQ,x); // 117
}
Post the error message(s) that you are getting with the associated line numbers and then we can help you.
"file is the basename stripped of its path"
Sure but what is the purpose of it? Notice what I put in the example in my first post. It seems like it doesn't matter what you put at all.
char* ls_args[2];
ls_args[0] = "../..";
ls_args[1] = 0;
execve("/bin/ls", ls_args, 0);
When executing the above code, it just does an ls on the current directory. Array element [0] is...
Thanks guys. I made the counter as suggested. Just a global variable that holds the initial size I set (the "100") and checks against it after every read, and increment if necessary. Thanks again.
Hmm, ok. I guess I need to find another way to do this but I am having a lot of trouble.
I have two strings, string1 and string_total.
I am receiving data on string1 and then concatenating into...
Is there any way to know how many bytes I allocated? Example:
char *mystring = (char *) malloc ( 100 * sizeof(char));
mystring = "1234512345";
Is there any way to get the "100" somehow?
...
Thank you! The extra * in void test(char **testptr) along with the & in main was what I needed! Perfect!
How do I pass it by reference?
I tried test( &testptr ) but that gives a warning: passing argument 1 of \u2018test\u2019 from incompatible pointer type
And still doesn't save the value either =\
testptr
I pass it to function. It gets the correct value.
Back in main it has crap value.
Why doesn't it retain the value set in the function?
void test(char *testptr)
{
testptr = "hello world";
// 2. GDB says tesptr has value: 0x80487cc "hello world"
}
int main()
{
char *testptr;
Thanks!
int x = 0;
while(true)
{
cout << "Hello World! " << x << "\n";
x++;
sleep(5);
}
while(true)
{
if (system uptime % 5 == 0)
{
//do stuff
}
}
Is there a better way to do this than with the system up time? (Is there an actual command in C++ to perform an action every x...
AH!!!!!!!!!!!!!!!!!!!!!
Lol
Thank you, works now :)