ok so jus to confirm again. r and ptr will be the same if place in memory is not changed. r and ptr will be different if place in memory is changed. thanks
Type: Posts; User: cstudent
ok so jus to confirm again. r and ptr will be the same if place in memory is not changed. r and ptr will be different if place in memory is changed. thanks
given the followng code, am i right to say that pointer r and ptr will be the same if the location of the memory does change? r will only take a new position if it needs to shift to another part of...
hi i have the following code to delete a node from my linked list but it seems that theres something wrong with it. can anyone assist me with this?
/* function to delete a node on list */...
ic thanks salem
hi, i got a question. For:
execl("/usr/bin/cat", "cat", "/crap data", NULL);
fprintf(stderr, " error");
shldnt the fprintf be executed if execl of cat fail??
ic thanks!
hi, does the child process have access to the parents declared variable?
hello, i am trying to emulate execution of multiple commands like what the shell does. i have some concepts in mind and i hope u guys can correct me if im wrong.
example command: ls -a | sort
...
i edited the code to the following and its working.
/* concatenate command and get command count */
for(i = 0; i < cmdWords; i++) {
strcat(cmdStr, words[i]);
strcat(cmdStr, " ");...
why am i assigning the values to temp instead? i dun understand :(
hello, i have the following code... in order to resolve strtok problem, i made a duplicate copy of cmdList named cmdListDup and did a strtok on cmdListDup instead... why am i still getting a modified...
hi, i have a string :
char* string = "ls -a";
do i have to extract ls out from the entire string to use execlp/execvp/execl/... command? is there a way to run the command without extracting it?
sigh wat a pain the the ass !
oh btw, how do u duplicate a copy of char **line with char** lineDup ??
do a loop of line and assign values to lineDup??
heh thanks.
ah i thought of it. maybe if i create a duplicate of line and use strtok on it instead.... maybe it will work. yea theres a reason. i can only have a set of specific files
hahahaha i understand now.. kinda crappy :/ now.. i gotta think of another way to overcome this :( cos i cant use another your awesome strtok function :( hopefully most of my brain cells will survive.
thanks i will try it out. however, im still interested in knowing how to overcome this problem. am i right to say that when i do temp = strtok(line[i], " "); , something is modified to line?
hi again, i have the following code and it has some problem. after doing strtok for the 1st time, when i print out the value of line[0], it returns "hello -a" which is correct. then after the next...
solved thanks. a counter is needed.
hmm i think i got it. u need a reference to how many items are stored within the array right?
hello, how do u loop a pointer to a string char** something and retrieve the value ?
right thanks
oh.. what i actually meant was for
for( i = 0; i < sizeof(buffer); i++)
if i do a malloc of buffer=(char**)malloc(1000); for example.
does sizeof retrieves 1000 or will it jus get the array...
for the second loop, size of buffer will returns the size of memory i allocate for the buffer right? in dat case, if i loop thru the array using the following code, will it be a problem?
/* loop...