Search:

Type: Posts; User: it01y2

Search: Search took 0.01 seconds.

  1. Thread: Reallocing help

    by it01y2
    Replies
    10
    Views
    1,234

    Error

    I have tried the above but keep on getting an error....

    Thanks for the pointers anyway mate.
  2. Thread: Reallocing help

    by it01y2
    Replies
    10
    Views
    1,234

    Realloc

    I have managed to realloc the elements in the array perfectly, however I am trying still to realloc the rows in the array, i keep on getting on getting a segmentation fault?
  3. Thread: Reallocing help

    by it01y2
    Replies
    10
    Views
    1,234

    Bug

    Running the code, I get this error, I think that reallocating is not working:

    I have previously malloced the ammount of commands to 2, realloc should come into play and allow the extra commands to...
  4. Thread: Reallocing help

    by it01y2
    Replies
    10
    Views
    1,234

    Realloc

    I have left out realloc as I am unsure how to use it correctly, I have looked at the man pages but cant implement it a 3d array effectively so it works.

    I keep on getting various memory related...
  5. Thread: Reallocing help

    by it01y2
    Replies
    10
    Views
    1,234

    Problem

    My real problem is the realloc and mallocing issue, I am not sure what i am doing wrong, I have used various commands but keep on getting malloc/realloc errors.

    Can i PM you my full code to test...
  6. Thread: Reallocing help

    by it01y2
    Replies
    10
    Views
    1,234

    Reallocing help

    I am trying to split a string inputted into a 3d array, is soon as a new entry has been found when strtoking it then reallocing will come into play to compensate for the entry.

    If it detects a '>'...
  7. Thread: Signals

    by it01y2
    Replies
    4
    Views
    1,480

    Signals

    I am trying to work out how to detect a ctrl c, if the ctrl c is detected in the child the child of the parent will exit and return to the parent currently running a command line. I have tried to use...
  8. Thread: strtok Error

    by it01y2
    Replies
    2
    Views
    2,017

    strtok Error

    I am compiling with the -ansi flag, i get the following errors:



    p1.c: In function ‘main’:
    p1.c:76: warning: assignment makes pointer from integer without a cast
    p1.c:79: warning: assignment...
  9. Replies
    25
    Views
    2,502

    Thanks - Qsort complete

    I managed to complete it, thanks to everyone who helped me :)
  10. Replies
    25
    Views
    2,502

    Ouch alot of prints

    When I printf i get stacks of values, its crazy, identifying this error may take some time :(
  11. Replies
    25
    Views
    2,502

    Sorting doesn't work

    I have tried to create the compare function but im doing something wrong:



    int struct_cmp(const void *a, const void *b) /* Compare integer function */
    {
    struct pers *ia = (struct pers *)a;...
  12. Replies
    25
    Views
    2,502

    *shrug* I really dont understand this, how would...

    *shrug* I really dont understand this, how would you do it?
  13. Replies
    25
    Views
    2,502

    Qsort function

    In the function im going to have to pass the struct by pointer into the compare function, then access the childs to do a comparison im guessing so?
  14. Replies
    25
    Views
    2,502

    Qsort function

    KK i see, ty
  15. Replies
    25
    Views
    2,502

    Point 3

    qsort(q[j].person,400,sizeof(struct queue),struct_cmp);


    I am not sure how to get the sizeof one element?
  16. Replies
    25
    Views
    2,502

    Qsort function

    Thanks for the tips dude, really appreciate it. Its just implementing this now, I will give it a go.
  17. Replies
    25
    Views
    2,502

    Qsort function

    This is my qsort function:


    for(j=0; j < 22; j++)
    {
    qsort(p[j].person,p[j].number,sizeof(struct queue),struct_cmp);
    }
  18. Replies
    25
    Views
    2,502

    Urgent Help - Qsort

    Hi I am trying to qsort a struct, here is my code for my struct:



    struct pers
    {
    char *name;
    int age;
    };
  19. Code

    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <sys/types.h>
    #include <sys/wait.h>
    #include <string.h>
    #include "simpleio.h"

    int main(int arc, char **argv, char **envp)...
  20. I have looked around for the solution but cant...

    I have looked around for the solution but cant get my code to work, can you help?
  21. Using the exec call function to execute an app

    Im just wondering how i can pass multiple parameters in this instance:

    Prompt the user to enter a program name and then input multiple parameters:

    e.g:Program Name: ls, First Parameter: -l (and...
Results 1 to 21 of 21