Search:

Type: Posts; User: cstudent

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    956

    ok so jus to confirm again. r and ptr will be the...

    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
  2. Replies
    3
    Views
    956

    Realloc Question

    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...
  3. Replies
    1
    Views
    1,563

    deleting node in linked list

    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 */...
  4. Replies
    3
    Views
    1,603

    ic thanks salem

    ic thanks salem
  5. Replies
    3
    Views
    1,603

    some help regarding execvp

    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??
  6. Replies
    3
    Views
    1,743

    ic thanks!

    ic thanks!
  7. Replies
    3
    Views
    1,743

    fork() question

    hi, does the child process have access to the parents declared variable?
  8. Thread: Commands

    by cstudent
    Replies
    1
    Views
    1,136

    Commands

    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
    ...
  9. Replies
    6
    Views
    1,860

    i edited the code to the following and its...

    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, " ");...
  10. Replies
    6
    Views
    1,860

    why am i assigning the values to temp instead? i...

    why am i assigning the values to temp instead? i dun understand :(
  11. Replies
    6
    Views
    1,860

    strtok problem again

    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...
  12. Replies
    2
    Views
    2,019

    executing commands

    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?
  13. Thread: strtok

    by cstudent
    Replies
    15
    Views
    2,339

    sigh wat a pain the the ass !

    sigh wat a pain the the ass !
  14. Thread: strtok

    by cstudent
    Replies
    15
    Views
    2,339

    oh btw, how do u duplicate a copy of char **line...

    oh btw, how do u duplicate a copy of char **line with char** lineDup ??

    do a loop of line and assign values to lineDup??
  15. Thread: strtok

    by cstudent
    Replies
    15
    Views
    2,339

    heh thanks.

    heh thanks.
  16. Thread: strtok

    by cstudent
    Replies
    15
    Views
    2,339

    ah i thought of it. maybe if i create a duplicate...

    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
  17. Thread: strtok

    by cstudent
    Replies
    15
    Views
    2,339

    hahahaha i understand now.. kinda crappy :/ now.....

    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.
  18. Thread: strtok

    by cstudent
    Replies
    15
    Views
    2,339

    thanks i will try it out. however, im still...

    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?
  19. Thread: strtok

    by cstudent
    Replies
    15
    Views
    2,339

    strtok

    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...
  20. Replies
    10
    Views
    1,358

    solved thanks. a counter is needed.

    solved thanks. a counter is needed.
  21. Replies
    10
    Views
    1,358

    hmm i think i got it. u need a reference to how...

    hmm i think i got it. u need a reference to how many items are stored within the array right?
  22. Replies
    10
    Views
    1,358

    getting all values from char**

    hello, how do u loop a pointer to a string char** something and retrieve the value ?
  23. Replies
    6
    Views
    1,665

    right thanks

    right thanks
  24. Replies
    6
    Views
    1,665

    oh.. what i actually meant was for for( i =...

    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...
  25. Replies
    6
    Views
    1,665

    for the second loop, size of buffer will returns...

    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...
Results 1 to 25 of 61
Page 1 of 3 1 2 3