What do you mean sort needs a parameter?
ls|sort works without a parameter for sort, no parameter means read from stdin, no? This is the case here, just instead of an ls output, there is another...
Type: Posts; User: alcaseltz
What do you mean sort needs a parameter?
ls|sort works without a parameter for sort, no parameter means read from stdin, no? This is the case here, just instead of an ls output, there is another...
What this code does is, parent process forks a child and then child forks a child. Parent writes a string to the pipe, child reads it and then writes it to the next pipe, the one connecting child and...
I am trying to figure out how pipes work so I have this code:
int main(){
int fdpipe[2];
pipe(fdpipe);
if(fork()!=0){//parent
dup2(fdpipe[1],1);
...
So firstly I want to ask why this:
add.c :
int add(int a,int b){
return a+b;
}
So what I want to do is something like that:
void function(char *ar[]){
strcpy(ar[0],"blablabla");
}
int main(){
char str[100][200];
function(str); //wrong