Hello
I have a problem to fork ...
In fact my command is like
"cd /pathy/; runny -arg1 AA -arg2 BB"
runny is an executable in the directory pathy.
Before, I made a system call like : system("cd /pathy/; runny -arg1 AA -arg2 BB")
system open a shell then run the line...
Oh ...
Ok ... anyway I am sick today ... it is my excuse ... I should not answers ... marsd is right ... I absolutly didn't get the question in fact ...
here a small example with my apologize : about popen
#include <stdio.h>
int main (int argc, char **argv)
{
FILE* flux;
char...
There is no special tricky things to do this.
On the most system, the pipe ( | ) or redirection ( < ) is the same than the standard IO of your C program.
you just have to remember than the IO is a text line. if you make a program (Ony) witch return the letter "T" or what ever...
re re Hello
then the best to see it is to try this
#include <stdlib.h>
int main(int argc, char **argv)
{
system("ls -l");
return 0;
}
there is abolutly no dependances between main's arguments and what you write in the system line.
except if you construct the "ls...
Re Hello
My answers is in the other post about linking ...
The only thing I want to write more is that the word "link" as nothing to do with the system call ...
usually when you have only libraries (without main function) ... you compile with the -c option and you create an objetc...
Hello
By the small code you wrote, the first things to say is that it is correct.
Then the core dump might come from what you are putting in the system call eg : "program1" "program2" etc ... I mean the core dump come from the other programs.
If I have no choice than...
I am not very sure if I will answer correctly ... but here there is my first answers of all.
I think you forgot to feed your vector in the struc A_Bucket
this what I tested :
#include<vector>
#include <iostream>
using namespace std;
struct A_key {
char *key;
long total;
};
struct...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.